summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguillaume <guillaume>2007-01-28 20:00:00 +0000
committerguillaume <guillaume>2007-01-28 20:00:00 +0000
commita2c56242dc5c2cd0ad57e6122ef1cfd16ff0a64a (patch)
treec82421937d051c9473688afd240f9ac61e37b73c
parent59dea13999e4007e605f65ccbb1e24e24668a33f (diff)
downloadberyl-desktop-manager-a2c56242dc5c2cd0ad57e6122ef1cfd16ff0a64a.tar.gz
beryl-desktop-manager-a2c56242dc5c2cd0ad57e6122ef1cfd16ff0a64a.tar.bz2
bdm: renderText positionning/scaling
-rw-r--r--src/bdm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bdm.c b/src/bdm.c
index 5cf5852..44a2532 100644
--- a/src/bdm.c
+++ b/src/bdm.c
@@ -99,14 +99,18 @@ static void renderText (cairo_t * cr, BDMText * text, ScreenArea * area)
cairo_save(cr);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ pango_layout_get_pixel_size (layout, &w, &h);
+ cairo_scale (cr, (float)text->attrib->width/(float)w,
+ (float)text->attrib->height/(float)h);
cairo_rotate(cr,text->attrib->xrot);
cairo_set_source_rgba (cr, text->color[0] / 65535.0, text->color[1] / 65535.0,
text->color[2] / 65535.0, text->color[3] / 65535.0);
-
+ cairo_move_to (cr, text->widget->attrib->x + text->attrib->x,
+ text->widget->attrib->y + text->attrib->y);
pango_cairo_show_layout (cr, layout);
cairo_paint_with_alpha(cr, text->attrib->alpha);
- g_object_unref (layout);
+ g_object_unref (layout);
cairo_restore (cr);
}