shadow: Redo shadow implementation for rotations

The shadows went bonkers when the labels were rotated
This commit is contained in:
Benjamin Otte 2011-05-22 04:24:23 +02:00
parent ec34c4bd83
commit 962ecc6fa5
3 changed files with 8 additions and 7 deletions

View File

@ -258,13 +258,14 @@ _gtk_shadow_to_string (GtkShadow *shadow)
void
_gtk_text_shadow_paint_layout (GtkShadow *shadow,
cairo_t *cr,
gdouble x,
gdouble y,
PangoLayout *layout)
{
GList *l;
GtkShadowElement *element;
if (!cairo_has_current_point (cr))
cairo_move_to (cr, 0, 0);
/* render shadows starting from the last one,
* and the others on top.
*/
@ -274,10 +275,11 @@ _gtk_text_shadow_paint_layout (GtkShadow *shadow,
cairo_save (cr);
cairo_move_to (cr, x + element->hoffset, y + element->voffset);
cairo_rel_move_to (cr, element->hoffset, element->voffset);
gdk_cairo_set_source_rgba (cr, &element->color);
_gtk_pango_fill_layout (cr, layout);
cairo_rel_move_to (cr, -element->hoffset, -element->voffset);
cairo_restore (cr);
}
}

View File

@ -55,8 +55,6 @@ gboolean _gtk_shadow_get_resolved (GtkShadow *shadow);
void _gtk_text_shadow_paint_layout (GtkShadow *shadow,
cairo_t *cr,
gdouble x,
gdouble y,
PangoLayout *layout);
G_END_DECLS

View File

@ -2429,13 +2429,14 @@ gtk_theming_engine_render_layout (GtkThemingEngine *engine,
"text-shadow", &text_shadow,
NULL);
prepare_context_for_layout (cr, x, y, layout);
if (text_shadow != NULL)
{
_gtk_text_shadow_paint_layout (text_shadow, cr, x, y, layout);
_gtk_text_shadow_paint_layout (text_shadow, cr, layout);
_gtk_shadow_unref (text_shadow);
}
prepare_context_for_layout (cr, x, y, layout);
gdk_cairo_set_source_rgba (cr, &fg_color);
pango_cairo_show_layout (cr, layout);