mirror of
https://github.com/brl/mutter.git
synced 2025-06-12 16:33:58 +00:00
[clutter-text] Fix ellipsizing
Ellipsizing was effectively broken for two reasons. There was a typo in the code to set the width so it always ended up being some massive value. If no height should be set on the layout it was being set to G_MAXINT. Setting a height greater than 0 enables wrapping which so ellipsizing is not performed. It should be left at the default of -1 instead.
This commit is contained in:
@ -333,7 +333,7 @@ clutter_text_create_layout_no_cache (ClutterText *text,
|
||||
gint width;
|
||||
|
||||
width = allocation_width > 0
|
||||
? CLUTTER_UNITS_FROM_PANGO_UNIT (allocation_width)
|
||||
? CLUTTER_UNITS_TO_PANGO_UNIT (allocation_width)
|
||||
: -1;
|
||||
|
||||
pango_layout_set_width (layout, width);
|
||||
@ -360,8 +360,6 @@ clutter_text_create_layout_no_cache (ClutterText *text,
|
||||
|
||||
pango_layout_set_height (layout, height);
|
||||
}
|
||||
else
|
||||
pango_layout_set_height (layout, G_MAXINT);
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
Reference in New Issue
Block a user