summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-05 23:57:02 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-07-05 23:57:02 +0000
commitf9364a0e6e08140111dc8310eb753c456993c200 (patch)
tree4a66b59e7e9835f150a2b9acc1f9d2f895bf9bf7
parent467bda1e0bc2614b10e2edc46dccc9588388e045 (diff)
parent7549d36af2e79ebd86ae9cc05a86bfdc22dfebf8 (diff)
downloadpango-f9364a0e6e08140111dc8310eb753c456993c200.tar.gz
Merge branch 'fix-strikethrough-averaging' into 'master'
renderer: Fix averaging of strikethroughs Closes #574 See merge request GNOME/pango!358
-rw-r--r--pango/pango-renderer.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index 49eec91d..f575707f 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -282,18 +282,22 @@ draw_strikethrough (PangoRenderer *renderer,
LineState *state)
{
PangoRectangle *rect = &state->strikethrough_rect;
- gboolean strikethrough = state->strikethrough;
int num_glyphs = state->strikethrough_glyphs;
- state->strikethrough = FALSE;
-
- if (strikethrough)
+ if (state->strikethrough)
pango_renderer_draw_rectangle (renderer,
PANGO_RENDER_PART_STRIKETHROUGH,
rect->x,
rect->y / num_glyphs,
rect->width,
rect->height / num_glyphs);
+
+ state->strikethrough = FALSE;
+ state->strikethrough_glyphs = 0;
+ rect->x += rect->width;
+ rect->width = 0;
+ rect->y = 0;
+ rect->height = 0;
}
static void
@@ -336,8 +340,6 @@ handle_line_state_change (PangoRenderer *renderer,
rect->width = state->logical_rect_end - rect->x;
draw_strikethrough (renderer, state);
state->strikethrough = renderer->strikethrough;
- rect->x = state->logical_rect_end;
- rect->width = 0;
}
}
@@ -484,7 +486,6 @@ add_strikethrough (PangoRenderer *renderer,
}
else
{
- draw_strikethrough (renderer, state);
*current_rect = new_rect;
state->strikethrough = TRUE;
state->strikethrough_glyphs = num_glyphs;