diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-11-15 21:13:51 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-11-15 21:13:51 +0000 |
commit | 8797f632c8f9f91eb26573e86accd9fcc1ad6322 (patch) | |
tree | 27c403e166951fd4477f94f1bc8a49b02a1e2f9c /pango/pango-layout.c | |
parent | 2ada6694c44b01a1991b9fe8fa9ea7fcb6395709 (diff) | |
download | pango-8797f632c8f9f91eb26573e86accd9fcc1ad6322.tar.gz |
Fix problem where right-aligned lines weren't getting properly offset
Wed Nov 15 15:04:00 2000 Owen Taylor <otaylor@redhat.com>
* pango/pango-layout.c (pango_layout_get_extents_internal):
Fix problem where right-aligned lines weren't getting properly
offset because width was left as -1.
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 309e89ec..9b0d844e 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -1565,9 +1565,6 @@ get_line_extents_layout_coords (PangoLayout *layout, pango_layout_line_get_extents (line, line_ink_layout ? &line_ink : NULL, &line_logical); - /* layout_width can be -1 in which case we just get a bogus x/y for - * the line - */ get_x_offset (layout, line, layout_width, line_logical.width, &x_offset); /* Convert the line's extents into layout coordinates */ @@ -1610,8 +1607,12 @@ pango_layout_get_extents_internal (PangoLayout *layout, pango_layout_check_lines (layout); + /* When we are not wrapping, we need the overall width of the layout to figure + * out the x_offsets of each line. However, we only need the x_offsets if + * we are computing the ink_rect or individual line extents. + */ width = layout->width; - if (width == -1 && layout->alignment != PANGO_ALIGN_LEFT && ink_rect != NULL) + if (width == -1 && layout->alignment != PANGO_ALIGN_LEFT && (ink_rect || line_extents)) { PangoRectangle overall_logical; |