summaryrefslogtreecommitdiff
path: root/src/bdm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bdm.c')
-rw-r--r--src/bdm.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/bdm.c b/src/bdm.c
index 980aad2..14fbcfd 100644
--- a/src/bdm.c
+++ b/src/bdm.c
@@ -88,9 +88,11 @@ static void renderText (cairo_t * cr, BDMText * text, ScreenArea * area)
PangoLayout *layout;
int w, h;
- if (text->attrib->updateFont)
+ if (text->attrib->updateFont || !text->font)
updateFont (text);
+ cairo_save (cr);
+
layout = pango_cairo_create_layout (cr);
if (!layout)
{
@@ -107,23 +109,16 @@ static void renderText (cairo_t * cr, BDMText * text, ScreenArea * area)
pango_cairo_update_layout (cr, layout);
- cairo_save(cr);
-
cairo_set_operator (cr, text->attrib->cairoOperator);
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_rectangle (cr, text->widget->attrib->x, text->widget->attrib->y,
-// text->widget->attrib->x + w,
-// text->widget->attrib->y + h);
+ 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);
-// cairo_clip (cr);
pango_cairo_show_layout (cr, layout);
- cairo_paint_with_alpha (cr, text->attrib->alpha);
g_object_unref (layout);
cairo_restore (cr);