// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
+#include <dali-toolkit/internal/text/text-controller-event-handler.h>
#include <dali-toolkit/internal/text/text-controller-impl.h>
namespace
// Store the actual control's size to restore later.
const Size actualControlSize = visualModel->mControlSize;
- DoRelayout(controller,
+ DoRelayout(impl,
requestedControllerSize,
static_cast<OperationsMask>(onlyOnceOperations |
requestedOperationsMask),
Vector3 naturalSizeVec3;
// Make sure the model is up-to-date before layouting
- controller.ProcessModifyEvents();
+ EventHandler::ProcessModifyEvents(controller);
Controller::Impl& impl = *controller.mImpl;
ModelPtr& model = impl.mModel;
TextUpdateInfo& textUpdateInfo = impl.mTextUpdateInfo;
impl.mFontDefaults->mFitPointSize = pointSize;
impl.mFontDefaults->sizeDefined = true;
- controller.ClearFontData();
+ impl.ClearFontData();
// Operations that can be done only once until the text changes.
const OperationsMask onlyOnceOperations = static_cast<OperationsMask>(CONVERT_TO_UTF32 |
// Make sure the model is up-to-date before layouting
impl.UpdateModel(onlyOnceOperations);
- DoRelayout(controller,
+ DoRelayout(impl,
Size(layoutSize.width, MAX_FLOAT),
static_cast<OperationsMask>(onlyOnceOperations | LAYOUT),
textSize);
float minPointSize = impl.mTextFitMinSize;
float maxPointSize = impl.mTextFitMaxSize;
float pointInterval = impl.mTextFitStepSize;
+ float currentFitPointSize = impl.mFontDefaults->mFitPointSize;
model->mElideEnabled = false;
Vector<float> pointSizeArray;
}
model->mElideEnabled = actualellipsis;
+ if(currentFitPointSize != pointSizeArray[bestSizeIndex])
+ {
+ impl.mTextFitChanged = true;
+ }
impl.mFontDefaults->mFitPointSize = pointSizeArray[bestSizeIndex];
impl.mFontDefaults->sizeDefined = true;
- controller.ClearFontData();
+ impl.ClearFontData();
}
}
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::GetHeightForWidth %p width %f\n", &controller, width);
// Make sure the model is up-to-date before layouting
- controller.ProcessModifyEvents();
+ EventHandler::ProcessModifyEvents(controller);
Controller::Impl& impl = *controller.mImpl;
ModelPtr& model = impl.mModel;
textUpdateInfo.mCharacterIndex = 0u;
}
- if(model->mMatchSystemLanguageDirection && impl.mLayoutDirection != layoutDirection)
+ if(impl.mLayoutDirection != layoutDirection)
{
// Clear the update info. This info will be set the next time the text is updated.
textUpdateInfo.mClearAll = true;
GET_GLYPH_METRICS |
SHAPE_TEXT |
UPDATE_DIRECTION |
+ ALIGN |
LAYOUT |
BIDI_INFO |
REORDER);
}
// Make sure the model is up-to-date before layouting.
- controller.ProcessModifyEvents();
+ EventHandler::ProcessModifyEvents(controller);
bool updated = impl.UpdateModel(operationsPending);
// Layout the text.
Size layoutSize;
- updated = DoRelayout(controller, size, operationsPending, layoutSize) || updated;
+ updated = DoRelayout(impl, size, operationsPending, layoutSize) || updated;
if(updated)
{
if(!isEditable || !controller.IsMultiLineEnabled())
{
// After doing the text layout, the vertical offset to place the actor in the desired position can be calculated.
- controller.CalculateVerticalOffset(size);
+ CalculateVerticalOffset(controller, size);
}
if(isEditable)
return updateTextType;
}
-bool Controller::Relayouter::DoRelayout(Controller& controller, const Size& size, OperationsMask operationsRequired, Size& layoutSize)
+bool Controller::Relayouter::DoRelayout(Controller::Impl& impl, const Size& size, OperationsMask operationsRequired, Size& layoutSize)
{
- DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::DoRelayout %p size %f,%f\n", &controller, size.width, size.height);
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::Relayouter::DoRelayout %p size %f,%f\n", &impl, size.width, size.height);
bool viewUpdated(false);
- Controller::Impl& impl = *controller.mImpl;
-
// Calculate the operations to be done.
const OperationsMask operations = static_cast<OperationsMask>(impl.mOperationsPending & operationsRequired);
(lastIndex > charactersToGlyph.Count() && charactersToGlyph.Count() > 0u))
{
std::string currentText;
- controller.GetText(currentText);
+ impl.GetText(currentText);
DALI_LOG_ERROR("Controller::DoRelayout: Attempting to access invalid buffer\n");
DALI_LOG_ERROR("Current text is: %s\n", currentText.c_str());
// Update the ellipsis
bool elideTextEnabled = impl.mModel->mElideEnabled;
+ auto ellipsisPosition = impl.mModel->mEllipsisPosition;
if(NULL != impl.mEventData)
{
// Reset the scroll position in inactive state
if(elideTextEnabled && (impl.mEventData->mState == EventData::INACTIVE))
{
- controller.ResetScrollPosition();
+ impl.ResetScrollPosition();
}
}
viewUpdated = impl.mLayoutEngine.LayoutText(layoutParameters,
newLayoutSize,
elideTextEnabled,
- isAutoScrollEnabled);
+ isAutoScrollEnabled,
+ ellipsisPosition);
impl.mIsAutoScrollEnabled = isAutoScrollEnabled;
viewUpdated = viewUpdated || (newLayoutSize != layoutSize);
lines,
impl.mModel->mAlignmentOffset,
impl.mLayoutDirection,
- impl.mModel->mMatchSystemLanguageDirection);
+ (impl.mModel->mMatchLayoutDirection != DevelText::MatchLayoutDirection::CONTENTS));
viewUpdated = true;
}
#if defined(DEBUG_ENABLED)
std::string currentText;
- controller.GetText(currentText);
- DALI_LOG_INFO(gLogFilter, Debug::Concise, "Controller::DoRelayout [%p] mImpl->mIsTextDirectionRTL[%s] [%s]\n", &controller, (impl.mIsTextDirectionRTL) ? "true" : "false", currentText.c_str());
+ impl.GetText(currentText);
+ DALI_LOG_INFO(gLogFilter, Debug::Concise, "Controller::Relayouter::DoRelayout [%p] mImpl->mIsTextDirectionRTL[%s] [%s]\n", &impl, (impl.mIsTextDirectionRTL) ? "true" : "false", currentText.c_str());
#endif
- DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::DoRelayout, view updated %s\n", (viewUpdated ? "true" : "false"));
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::Relayouter::DoRelayout, view updated %s\n", (viewUpdated ? "true" : "false"));
return viewUpdated;
}