X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-relayouter.cpp;h=134a327f772313a5e01d3d71d1dd4f4fbcef3b2e;hb=78c772dd32c14bd500d6d3378ffa3a6e87dc60fa;hp=78e7331ad633adc8ba2def3c146fbd9cb895a41f;hpb=9161d9828d1a5bb3c7eaf83002863de84b23b751;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller-relayouter.cpp b/dali-toolkit/internal/text/text-controller-relayouter.cpp index 78e7331..134a327 100644 --- a/dali-toolkit/internal/text/text-controller-relayouter.cpp +++ b/dali-toolkit/internal/text/text-controller-relayouter.cpp @@ -291,7 +291,10 @@ float Controller::Relayouter::GetHeightForWidth(Controller& controller, float wi // The implementation of Get LineCount property depends on calling GetHeightForWidth then read mLines.Count() from visualModel direct. // If the LineCount property is requested before rendering and layouting then the value will be zero, which is incorrect. // So we will not restore the previously backed-up mLines and mGlyphPositions from visualModel in such case. - bool restoreLinesAndGlyphPositions = visualModel->mControlSize.width>0 && visualModel->mControlSize.height>0; + // Another case to skip restore is when the requested width equals the Control's width which means the caller need to update the old values. + // For example, when the text is changed. + bool restoreLinesAndGlyphPositions = (visualModel->mControlSize.width>0 && visualModel->mControlSize.height>0) + && (visualModel->mControlSize.width != width); layoutSize = CalculateLayoutSizeOnRequiredControllerSize(controller, sizeRequestedWidthAndMaxHeight, requestedOperationsMask, restoreLinesAndGlyphPositions);