summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@comhem.se>2007-09-03 00:16:26 +0200
committerDana Jansens <danakj@orodu.net>2008-02-03 00:28:02 -0500
commit3592046b2b26e05ee94c0dd0fed5b7fd5475c198 (patch)
tree4cba2439142137bd4c0bbe8861c852ebd002dd13 /render
parentda5f4e08f5e77fe6fe54d65b668aa129150b281b (diff)
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.
Diffstat (limited to 'render')
-rw-r--r--render/render.c18
-rw-r--r--render/render.h5
2 files changed, 19 insertions, 4 deletions
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;
}
diff --git a/render/render.h b/render/render.h
index 1f87c6e0..7b81e2ff 100644
--- a/render/render.h
+++ b/render/render.h
@@ -165,6 +165,11 @@ struct _RrTextureRGBA {
gint cwidth;
gint cheight;
RrPixel32 *cache;
+/* size and position to draw at */
+ gint tx;
+ gint ty;
+ gint twidth;
+ gint theight;
};
struct _RrTextureLineArt {