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 687286 - Icon view text rows misaligned
Icon view text rows misaligned
Status: RESOLVED FIXED
Product: libgd
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libgd maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-10-31 19:18 UTC by Zeeshan Ali
Modified: 2012-11-08 14:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of misaligned icon view text (149.38 KB, image/png)
2012-10-31 19:18 UTC, Zeeshan Ali
Details
Another screenshot w/ fake labels (119.34 KB, image/png)
2012-11-06 09:42 UTC, Zeeshan Ali
Details
Screenshot of regression (120.50 KB, image/png)
2012-11-08 10:50 UTC, Zeeshan Ali
Details

Description Zeeshan Ali 2012-10-31 19:18:13 UTC
Created attachment 227753 [details]
Screenshot of misaligned icon view text

As you can see in the attached screenshot, the text columns of the 2nd item are misaligned towards the right. Probably a libgd bug but need to investigate..
Comment 1 Zeeshan Ali 2012-11-06 09:42:33 UTC
Created attachment 228226 [details]
Another screenshot w/ fake labels

Here is another screenshot of the issue with fake labels. Looking at both screenshots, it seems that text is centered if it fits in the same line.
Comment 2 Alexander Larsson 2012-11-06 10:15:41 UTC
This is an issue in libgd/gd-two-lines-renderer.c when using wrap-width

It sets the layout widths based on wrap_width, and then does the layout calculation based on that, but then gd_two_lines_renderer_render() does:

  /* now render the first layout */
  pango_layout_set_width (layout_one,
                          (cell_area->width - x_offset_1 - 2 * xpad) *  
                           PANGO_SCALE);

This overrides the wrap_width to the full width after then initial centering of the label. This causes the wrapping to change and the label to look off-center.

Just deleting the two set_width from gd_two_lines_renderer_render() fixes this case. But I'm not sure if they are required for some other case?
Comment 3 Cosimo Cecchi 2012-11-06 21:38:30 UTC
I pushed a fix for this bug now, thanks for the report.
Comment 4 Zeeshan Ali 2012-11-08 10:50:53 UTC
Created attachment 228457 [details]
Screenshot of regression

This fix seems to cause a regression. See attached screenshot. The 2nd line is supposed to say "Installing.."
Comment 5 Cosimo Cecchi 2012-11-08 14:05:09 UTC
Thanks, I missed one last part of the fix; can you try again with libgd master? I pushed another patch that should solve this.
Comment 6 Zeeshan Ali 2012-11-08 14:52:26 UTC
(In reply to comment #5)
> Thanks, I missed one last part of the fix; can you try again with libgd master?
> I pushed another patch that should solve this.

Yup, that fixes the last issue. Thanks for the quick action. Now i can do the demo at KVM forum tomorrow. :)