diff options
-rw-r--r-- | src/bdm.c | 15 | ||||
-rw-r--r-- | src/testWidget.c | 4 |
2 files changed, 7 insertions, 12 deletions
@@ -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); diff --git a/src/testWidget.c b/src/testWidget.c index d55c3d6..5999374 100644 --- a/src/testWidget.c +++ b/src/testWidget.c @@ -12,8 +12,8 @@ int init (BDMWidget * widget) images->attrib = malloc(sizeof(BDMPaintAttribs)); - images->attrib->x = 500; - images->attrib->y = 500; + images->attrib->x = 100; + images->attrib->y = 100; images->attrib->alpha = 1.0f; images->attrib->width = 100; images->attrib->height = 100; |