DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
// Check the ellipsis property
- DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
- label.SetProperty( TextLabel::Property::ELLIPSIS, true );
DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
+ label.SetProperty( TextLabel::Property::ELLIPSIS, false );
+ DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
// Check the layout direction property
label.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
* @param[in,out] numberOfLines The number of laid-out lines.
* @param[in] penY The vertical layout position.
* @param[in] currentParagraphDirection The current paragraph's direction.
+ * @param[in,out] isAutoScrollEnabled If the isAutoScrollEnabled is true and the height of the text exceeds the boundaries of the control the text is elided and the isAutoScrollEnabled is set to false to disable the autoscroll
*
* return Whether the line is ellipsized.
*/
Vector2* glyphPositionsBuffer,
Length& numberOfLines,
float penY,
- CharacterDirection currentParagraphDirection )
+ CharacterDirection currentParagraphDirection,
+ bool& isAutoScrollEnabled )
{
- const bool ellipsis = ( ( penY - layout.descender > layoutParameters.boundingBox.height ) ||
- ( ( mLayout == SINGLE_LINE_BOX ) &&
- ( layout.extraBearing + layout.length + layout.extraWidth > layoutParameters.boundingBox.width ) ) );
+ const bool ellipsis = isAutoScrollEnabled ? ( penY - layout.descender > layoutParameters.boundingBox.height ) :
+ ( ( penY - layout.descender > layoutParameters.boundingBox.height ) ||
+ ( ( mLayout == SINGLE_LINE_BOX ) &&
+ ( layout.extraBearing + layout.length + layout.extraWidth > layoutParameters.boundingBox.width ) ) );
if( ellipsis )
{
+ isAutoScrollEnabled = false;
// Do not layout more lines if ellipsis is enabled.
// The last line needs to be completely filled with characters.
Vector<Vector2>& glyphPositions,
Vector<LineRun>& lines,
Size& layoutSize,
- bool elideTextEnabled )
+ bool elideTextEnabled,
+ bool& isAutoScrollEnabled )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->LayoutText\n" );
DALI_LOG_INFO( gLogFilter, Debug::Verbose, " box size %f, %f\n", layoutParameters.boundingBox.width, layoutParameters.boundingBox.height );
glyphPositionsBuffer,
numberOfLines,
penY,
- currentParagraphDirection );
+ currentParagraphDirection,
+ isAutoScrollEnabled );
}
if( ellipsis )
Vector<Vector2>& glyphPositions,
Vector<LineRun>& lines,
Size& layoutSize,
- bool elideTextEnabled )
+ bool elideTextEnabled,
+ bool& isAutoScrollEnabled )
{
return mImpl->LayoutText( layoutParameters,
glyphPositions,
lines,
layoutSize,
- elideTextEnabled );
+ elideTextEnabled,
+ isAutoScrollEnabled );
}
void Engine::ReLayoutRightToLeftLines( const Parameters& layoutParameters,
* @param[out] lines The laid-out lines.
* @param[out] layoutSize The size of the text after it has been laid-out.
* @param[in] elideTextEnabled Whether the text elide is enabled.
+ * @param[in,out] isAutoScrollEnabled If the isAutoScrollEnabled is true and the height of the text exceeds the boundaries of the control the text is elided and the isAutoScrollEnabled is set to false to disable the autoscroll
*
* @return \e true if the text has been re-laid-out. \e false means the given width is too small to layout even a single character.
*/
Vector<Vector2>& glyphPositions,
Vector<LineRun>& lines,
Size& layoutSize,
- bool elideTextEnabled );
+ bool elideTextEnabled,
+ bool& isAutoScrollEnabled );
/**
* @brief Re-lays out those lines with right to left characters.
mImpl->mOperationsPending,
layoutSize ) || updated;
+
if( updated )
{
updateTextType = MODEL_UPDATED;
}
// Update the visual model.
+ bool isAutoScrollEnabled = mImpl->mIsAutoScrollEnabled;
Size newLayoutSize;
viewUpdated = mImpl->mLayoutEngine.LayoutText( layoutParameters,
glyphPositions,
mImpl->mModel->mVisualModel->mLines,
newLayoutSize,
- elideTextEnabled );
+ elideTextEnabled,
+ isAutoScrollEnabled );
+ mImpl->mIsAutoScrollEnabled = isAutoScrollEnabled;
viewUpdated = viewUpdated || ( newLayoutSize != layoutSize );