diff options
author | Gianluca Pacchiella <pacchiel@studenti.ph.unito.it> | 2007-07-28 09:49:58 +0200 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-08-01 01:09:09 +0930 |
commit | 32895d3ae72e90886b5f9dcc97c5a71aface7e69 (patch) | |
tree | 9a3e240e796815fb4c45087bff7b5cdbc512209c | |
parent | 9dbaed757776f24608d2787b40a2df9c9985e8f3 (diff) |
Fixed incorrect resize of background image.
-rw-r--r-- | src/Manager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Manager.cpp b/src/Manager.cpp index 53ff1e8..5ef35e1 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -85,13 +85,15 @@ void Manager::initX11(char* display) x11->width, x11->height, x11->depth); cairo_surface_t* cr_sf = cairo_xlib_surface_create(x11->dpy, pxBackground, x11->vis, x11->width, x11->height); + TRACE("Create background from %s\n",Config::getInstance()->imgBackground); cairo_surface_t* cr_png_sf = cairo_image_surface_create_from_png( Config::getInstance()->imgBackground); cairo_t* cr = cairo_create(cr_sf); int pngwidth, pngheight; pngwidth = cairo_image_surface_get_width(cr_png_sf); pngheight = cairo_image_surface_get_height(cr_png_sf); - cairo_scale(cr, (double)x11->width/pngwidth, x11->height/pngheight); + TRACE("Scaling image: %dx%d ---> %dx%d\n",x11->width,x11->height,pngwidth,pngheight); + cairo_scale(cr, (double)x11->width/pngwidth, (double)x11->height/pngheight); cairo_set_source_surface(cr, cr_png_sf, 0, 0); cairo_paint(cr); cairo_surface_destroy(cr_sf); |