X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flayouts%2Flayout-engine.cpp;h=39af47ce85a4a56eb4bfe19d9ae570306f919354;hp=41e41a9821483ab66957ed0ff1832c4e862296be;hb=c427acac5f2616578c05987c99e7b430c9ab0137;hpb=11ac31ab089b6b0d6cb8b06381724ac8c0ce126e diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 41e41a9..39af47c 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -1260,16 +1260,22 @@ struct Engine::Impl Length& numberOfLines, float penY, bool& isAutoScrollEnabled, + bool isAutoScrollMaxTextureExceeded, DevelText::EllipsisPosition::Type ellipsisPosition, bool enforceEllipsisInSingleLine) { - const bool ellipsis = enforceEllipsisInSingleLine || (isAutoScrollEnabled ? (penY - layout.descender > layoutParameters.boundingBox.height) : ((penY - layout.descender > layoutParameters.boundingBox.height) || ((mLayout == SINGLE_LINE_BOX) && (layout.length > layoutParameters.boundingBox.width)))); + const bool ellipsis = enforceEllipsisInSingleLine || (isAutoScrollEnabled ? isAutoScrollMaxTextureExceeded : ((penY - layout.descender > layoutParameters.boundingBox.height) || ((mLayout == SINGLE_LINE_BOX) && (layout.length > layoutParameters.boundingBox.width)))); const bool isMultiline = !enforceEllipsisInSingleLine && (mLayout == MULTI_LINE_BOX); if(ellipsis && (ellipsisPosition == DevelText::EllipsisPosition::END || !isMultiline)) { - isAutoScrollEnabled = false; - // Do not layout more lines if ellipsis is enabled. + if(penY - layout.descender > layoutParameters.boundingBox.height) + { + // Even if auto scroll is enabled and text is bigger than max texture size, + // if the the height is small, auto scroll should not work. + isAutoScrollEnabled = false; + } + // Do not layout more lines if ellipsis is enabled. // The last line needs to be completely filled with characters. // Part of a word may be used. @@ -1601,6 +1607,7 @@ struct Engine::Impl Size& layoutSize, bool elideTextEnabled, bool& isAutoScrollEnabled, + bool isAutoScrollMaxTextureExceeded, DevelText::EllipsisPosition::Type ellipsisPosition) { DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->LayoutText\n"); @@ -1801,7 +1808,7 @@ struct Engine::Impl CharacterIndex lastCharacterInParagraph = currentParagraphRun.characterRun.characterIndex + currentParagraphRun.characterRun.numberOfCharacters - 1; //check if this is the last line in paragraph, if false we should use the default relative line size (the one set using the property) - if(lastCharacterInParagraph >= layout.characterIndex && lastCharacterInParagraph < layout.characterIndex+layout.numberOfCharacters) + if(lastCharacterInParagraph >= layout.characterIndex && lastCharacterInParagraph < layout.characterIndex + layout.numberOfCharacters) { layout.relativeLineSize = mRelativeLineSize; } @@ -1840,6 +1847,7 @@ struct Engine::Impl numberOfLines, penY, isAutoScrollEnabled, + isAutoScrollMaxTextureExceeded, ellipsisPosition, false); } @@ -1858,6 +1866,7 @@ struct Engine::Impl numberOfLines, penY, isAutoScrollEnabled, + isAutoScrollMaxTextureExceeded, ellipsisPosition, true); } @@ -2252,12 +2261,14 @@ bool Engine::LayoutText(Parameters& layoutParameters, Size& layoutSize, bool elideTextEnabled, bool& isAutoScrollEnabled, + bool isAutoScrollMaxTextureExceeded, DevelText::EllipsisPosition::Type ellipsisPosition) { return mImpl->LayoutText(layoutParameters, layoutSize, elideTextEnabled, isAutoScrollEnabled, + isAutoScrollMaxTextureExceeded, ellipsisPosition); }