summaryrefslogtreecommitdiff
path: root/pango/pango-context.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-02 01:17:18 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-02 01:24:01 -0400
commit91687742f61d4b74572f3176fa3d8442438df504 (patch)
tree17b032d705eeeb5ae527d91d0eda4d2bdf523356 /pango/pango-context.c
parentc0697a15fb7c738ab0ff78dc4abedff896497749 (diff)
downloadpango-91687742f61d4b74572f3176fa3d8442438df504.tar.gz
itemize: Fix up gravity state initializationgravity-fix
itemize_state_init was setting gravity-related fields to their initial values too late, after update_attr_iterator has already set them to the values for the first run. Test included.
Diffstat (limited to 'pango/pango-context.c')
-rw-r--r--pango/pango-context.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c
index ac59f3d8..4f15dd61 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -1031,6 +1031,11 @@ itemize_state_init (ItemizeState *state,
state->embedding_end = text + start_index;
update_embedding_end (state);
+ state->gravity = PANGO_GRAVITY_AUTO;
+ state->centered_baseline = PANGO_GRAVITY_IS_VERTICAL (state->context->resolved_gravity);
+ state->gravity_hint = state->context->gravity_hint;
+ state->resolved_gravity = PANGO_GRAVITY_AUTO;
+
/* Initialize the attribute iterator
*/
if (cached_iter)
@@ -1088,10 +1093,6 @@ itemize_state_init (ItemizeState *state,
else
state->font_desc_gravity = PANGO_GRAVITY_AUTO;
- state->gravity = PANGO_GRAVITY_AUTO;
- state->centered_baseline = PANGO_GRAVITY_IS_VERTICAL (state->context->resolved_gravity);
- state->gravity_hint = state->context->gravity_hint;
- state->resolved_gravity = PANGO_GRAVITY_AUTO;
state->derived_lang = NULL;
state->current_fonts = NULL;
state->cache = NULL;