summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorracarr <racarr>2007-01-29 01:52:51 +0000
committerracarr <racarr>2007-01-29 01:52:51 +0000
commit6c01732296c69ae3cf3fe4f092ae28845cf26c23 (patch)
tree7d502b33bdee9981f31cf6a7bd8e63e17b61cedc
parent11c5d45357ed3d2e7354defb25a9962a706ea784 (diff)
downloadberyl-desktop-manager-6c01732296c69ae3cf3fe4f092ae28845cf26c23.tar.gz
beryl-desktop-manager-6c01732296c69ae3cf3fe4f092ae28845cf26c23.tar.bz2
Handle image 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 244d1a8..7589502 100644
--- a/src/bdm.c
+++ b/src/bdm.c
@@ -42,7 +42,6 @@ static void renderImage(cairo_t * cr, BDMImage * image, ScreenArea * area)
// cairo_set_source_rgba(cr,0,0,0,0);
// cairo_paint(cr);
cairo_save(cr);
- gdk_cairo_set_source_pixbuf(cr,image->pixbuf,0,0);
int widx = image->widget->attrib->x;
int widy = image->widget->attrib->y;
@@ -52,9 +51,14 @@ static void renderImage(cairo_t * cr, BDMImage * image, ScreenArea * area)
int width = image->pixW;
int height = image->pixH;
cairo_set_operator(cr,image->attrib->cairoOperator);
- cairo_scale(cr,(float)image->attrib->width/image->pixW,image->attrib->height/(float)image->pixH);
cairo_rotate(cr,image->attrib->xrot);
+ cairo_scale(cr,(float)image->attrib->width/(float)image->pixW,image->attrib->height/(float)image->pixH);
+
cairo_rectangle(cr,widx+x,widy+y,widx+x+width,widy+y+height);
+ cairo_clip(cr);
+ gdk_cairo_set_source_pixbuf(cr,image->pixbuf,0,0);
+
+
cairo_fill(cr);
cairo_stroke(cr);