summaryrefslogtreecommitdiff
path: root/pango/pango-context.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-01-16 10:11:24 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-01-16 10:11:24 +0000
commit7d3e758bf530501257f86ba73384c4e98ac48389 (patch)
tree21f2b4ec0fc73433cf10a3429dc9ac641aacfae6 /pango/pango-context.c
parent0b0ddda32b910686118f8d7669364bc6d172e37a (diff)
downloadpango-7d3e758bf530501257f86ba73384c4e98ac48389.tar.gz
Update centered_baseline in presence of gravity attributes.
2007-01-16 Behdad Esfahbod <behdad@gnome.org> * pango/pango-context.c (itemize_state_init), (itemize_state_update_for_new_run): Update centered_baseline in presence of gravity attributes. svn path=/trunk/; revision=2147
Diffstat (limited to 'pango/pango-context.c')
-rw-r--r--pango/pango-context.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 53b86302..cbde4efd 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -849,15 +849,13 @@ itemize_state_init (ItemizeState *state,
update_end (state);
- state->centered_baseline = state->context->resolved_gravity == PANGO_GRAVITY_EAST
- || state->context->resolved_gravity == PANGO_GRAVITY_WEST;
-
if (pango_font_description_get_set_fields (state->font_desc) & PANGO_FONT_MASK_GRAVITY)
state->font_desc_gravity = pango_font_description_get_gravity (state->font_desc);
else
state->font_desc_gravity = PANGO_GRAVITY_AUTO;
state->gravity = PANGO_GRAVITY_AUTO;
+ state->centered_baseline = FALSE;
state->gravity_hint = state->context->gravity_hint;
state->resolved_gravity = PANGO_GRAVITY_AUTO;
state->derived_lang = NULL;
@@ -1220,22 +1218,22 @@ itemize_state_update_for_new_run (ItemizeState *state)
PangoGravity old_gravity = state->resolved_gravity;
if (state->font_desc_gravity != PANGO_GRAVITY_AUTO)
- state->resolved_gravity = state->font_desc_gravity;
+ {
+ state->resolved_gravity = state->font_desc_gravity;
+ state->centered_baseline = PANGO_GRAVITY_IS_VERTICAL (state->resolved_gravity);
+ }
else
{
- PangoGravity gravity;
- PangoGravityHint gravity_hint;
+ PangoGravity gravity = state->gravity;
+ PangoGravityHint gravity_hint = state->gravity_hint;
- gravity = state->gravity;
if (G_LIKELY (gravity == PANGO_GRAVITY_AUTO))
gravity = state->context->resolved_gravity;
- gravity_hint = state->gravity_hint;
-
- gravity = pango_gravity_get_for_script (state->script,
- gravity,
- gravity_hint);
- state->resolved_gravity = gravity;
+ state->centered_baseline = PANGO_GRAVITY_IS_VERTICAL (gravity);
+ state->resolved_gravity = pango_gravity_get_for_script (state->script,
+ gravity,
+ gravity_hint);
}
if (old_gravity != state->resolved_gravity)