repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 49f22fbba9ebe8f218a6b783a0dfbcf713e7fd90: path_to: revision_to:
commit 49f22fbba9ebe8f218a6b783a0dfbcf713e7fd90 Author: Marc LehmannDate: Thu Jun 7 08:45:34 2012 +0000 *** empty log message *** diff --git a/src/rxvtimg.C b/src/rxvtimg.C
--- a/src/rxvtimg.C
+++ b/src/rxvtimg.C
@@ -116,9 +116,6 @@ rxvt_img::src_picture ()
pa.repeat = repeat;
Picture pic = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa);
- XRectangle clip = { -x, -y, min (w, ref->w), min (h, ref->h) };
- XRenderSetPictureClipRectangles (dpy, pic, 0, 0, &clip, 1);
-
return pic;
}
@@ -421,15 +418,18 @@ rxvt_img::reify ()
rxvt_img *
rxvt_img::sub_rect (int x, int y, int width, int height)
{
- rxvt_img *img = clone ();
+ bool need_reify = w < width || h < height;
- //TODO: width > w, must reify
+ rxvt_img *img = clone ();
img->x += x;
img->y += y;
img->w = width;
img->h = height;
+ if (need_reify)
+ img->reify ();
+
return img;
}
-----END OF PAGE-----