Merge lp://qastaging/~3v1n0/unity/static-cairo-text-fix-layout-width into lp://qastaging/unity
Status: | Merged |
---|---|
Approved by: | Andrea Azzarone |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3206 |
Proposed branch: | lp://qastaging/~3v1n0/unity/static-cairo-text-fix-layout-width |
Merge into: | lp://qastaging/unity |
Diff against target: |
112 lines (+31/-23) 1 file modified
unity-shared/StaticCairoText.cpp (+31/-23) |
To merge this branch: | bzr merge lp://qastaging/~3v1n0/unity/static-cairo-text-fix-layout-width |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Andrea Azzarone (community) | Approve | ||
Review via email: mp+152565@code.qastaging.launchpad.net |
Commit message
StaticCairoText: use the maximum size for setting the layout one in DrawText
Otherwise using the text-extent could make the StaticCairoText to use more lines
than the ones that it really needs (making the last one not being drawn).
Description of the change
Static Cairo Text is using a similar code to compute the actual text size and to draw it, however when drawing it uses the text-extents computed on the previous pass to set the new PangoLayout width. This is not correct since the text-extents width can be actually smaller than the space that the text may use.
This leads to two issues: (1) the text does not use all the horizontal space it could, (2) the last line can be cut off. As you can see for example in [1] or [2].
The fix consists on setting the PangoLayout sizes to the nux Area MaximumSizes (if set) or not to set them at all.
[1] http://
[2] http://
[3] http://
[4] http://
LGTM,