summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguillaume <guillaume>2007-01-29 03:00:46 +0000
committerguillaume <guillaume>2007-01-29 03:00:46 +0000
commitf2e75ffecd70d71c9809601059b2b5189e5988d9 (patch)
tree63c95a1e2bf2e3a0056863416f2c5857f374411c
parent623e9ea41083fe2cd3f90e059f1d82e492fa2a93 (diff)
downloadberyl-desktop-manager-f2e75ffecd70d71c9809601059b2b5189e5988d9.tar.gz
beryl-desktop-manager-f2e75ffecd70d71c9809601059b2b5189e5988d9.tar.bz2
bdm: better x/y for test image, working text!
-rw-r--r--src/bdm.c15
-rw-r--r--src/testWidget.c4
2 files changed, 7 insertions, 12 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);
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;