From 3592046b2b26e05ee94c0dd0fed5b7fd5475c198 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Mon, 3 Sep 2007 00:16:26 +0200 Subject: Make the icon and hilite the proper sizes. Had to add some obrender thingers and fiddle around a bit. Also fixed up some confusing logic. --- render/render.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'render/render.c') diff --git a/render/render.c b/render/render.c index 4119dc7f..7791429a 100644 --- a/render/render.c +++ b/render/render.c @@ -132,10 +132,20 @@ Pixmap RrPaintPixmap(RrAppearance *a, gint w, gint h) break; case RR_TEXTURE_RGBA: g_assert(!transferred); - RrImageDraw(a->surface.pixel_data, - &a->texture[i].data.rgba, - a->w, a->h, - &tarea); + { + RrRect narea = tarea; + RrTextureRGBA *rgb = &a->texture[i].data.rgba; + if (rgb->twidth) + narea.width = MIN(tarea.width, rgb->twidth); + if (rgb->theight) + narea.height = MIN(tarea.height, rgb->theight); + narea.x += rgb->tx; + narea.y += rgb->ty; + RrImageDraw(a->surface.pixel_data, + &a->texture[i].data.rgba, + a->w, a->h, + &narea); + } force_transfer = 1; break; } -- cgit v1.2.3