After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 549003 - pango_layout_set_height(): layout should not be cleared unless required
pango_layout_set_height(): layout should not be cleared unless required
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2008-08-22 13:14 UTC by Christian Neumair
Modified: 2008-08-22 16:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Neumair 2008-08-22 13:14:11 UTC
In pango_layout_set_height(), if pango_layout_is_ellipsized() is FALSE, and the new height is set to new_height where -new_height is larger than the line count (or equal to it), the lines should not be cleared.

This is relevant in Nautilus where we use

pango_layout_set_height(-G_MININT)
layout_request = pango_layout_get_extends ()

pango_layout_set_height(-sane_number_of_lines)
sane_layout_request = pango_layout_get_extends ()

usually, sane_number_of_lines will be larger than or equal to pango_layout_get_lines(), and no ellipsization takes place (although the mode is PANGO_ELLIPSIZE_END).
Comment 1 Behdad Esfahbod 2008-08-22 16:27:13 UTC
Makes sense.
Comment 2 Behdad Esfahbod 2008-08-22 16:41:35 UTC
Please test, or better, read the code and check that I didn't do anything stupid.

2008-08-22  Behdad Esfahbod  <behdad@gnome.org>

        Bug 549003 – pango_layout_set_height(): layout should not be cleared
        unless required

        * pango/pango-layout-private.h:
        * pango/pango-layout.c (pango_layout_init),
        (pango_layout_set_height), (pango_layout_get_line_count),
        (pango_layout_clear_lines), (add_line):
        Don't invalidate layout if the new height does not force 
        ellipsization.

Comment 3 Christian Neumair 2008-08-22 16:57:36 UTC
The change looks resonable, thanks for the quick response!