// Make sure the model is up-to-date before layouting
impl.UpdateModel(onlyOnceOperations);
+ bool layoutTooSmall = false;
DoRelayout(impl,
Size(layoutSize.width, MAX_FLOAT),
static_cast<OperationsMask>(onlyOnceOperations | LAYOUT),
- textSize);
+ textSize,
+ layoutTooSmall);
// Clear the update info. This info will be set the next time the text is updated.
textUpdateInfo.Clear();
textUpdateInfo.mClearAll = true;
- if(textSize.width > layoutSize.width || textSize.height > layoutSize.height)
+ if(layoutTooSmall || textSize.width > layoutSize.width || textSize.height > layoutSize.height)
{
return false;
}
bool Controller::Relayouter::DoRelayout(Controller::Impl& impl, const Size& size, OperationsMask operationsRequired, Size& layoutSize)
{
+ bool layoutTooSmall = false;
+ return DoRelayout(impl, size, operationsRequired, layoutSize, layoutTooSmall);
+}
+
+bool Controller::Relayouter::DoRelayout(Controller::Impl& impl, const Size& size, OperationsMask operationsRequired, Size& layoutSize, bool& layoutTooSmall)
+{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::Relayouter::DoRelayout %p size %f,%f\n", &impl, size.width, size.height);
DALI_TRACE_SCOPE(gTraceFilter2, "DALI_TEXT_DORELAYOUT");
bool viewUpdated(false);
isHiddenInputEnabled,
ellipsisPosition);
impl.mIsAutoScrollEnabled = isAutoScrollEnabled;
+ layoutTooSmall = !viewUpdated;
viewUpdated = viewUpdated || (newLayoutSize != layoutSize);
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::Relayouter::DoRelayout, view updated %s\n", (viewUpdated ? "true" : "false"));
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::Relayouter::DoRelayout, layout too small %s\n", (layoutTooSmall ? "true" : "false"));
return viewUpdated;
}
* @param[in] size The size to set
* @param[in] operationsRequired The operations we need to do
* @param[in/out] layoutSize The Layout size which can be updated depending on the result of the performed operations
- * @return
+ * @return whether view updated after relayout
*/
static bool DoRelayout(Controller::Impl& impl, const Size& size, OperationsMask operationsRequired, Size& layoutSize);
/**
+ * @brief Called by the Controller to do certain operations when relayouting.
+ *
+ * @param[in] impl A reference to the controller impl class
+ * @param[in] size The size to set
+ * @param[in] operationsRequired The operations we need to do
+ * @param[in/out] layoutSize The Layout size which can be updated depending on the result of the performed operations
+ * @param[out] layoutTooSmall True if layout is too small to render one glyph, else false.
+ * @return whether view updated after relayout
+ */
+
+ static bool DoRelayout(Controller::Impl& impl, const Size& size, OperationsMask operationsRequired, Size& layoutSize, bool& layoutTooSmall);
+
+ /**
* @brief Called by the Controller to calculate the veritcal offset give the control size.
*
* @param[in] impl A reference to the controller impl class