diff options
author | fvogel <fvogelnew1@free.fr> | 2023-07-16 13:28:34 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-07-16 13:28:34 (GMT) |
commit | 81da7830cb098eaccd1d444a8bd5defa37a25b84 (patch) | |
tree | a9a0bb126561028526eaab747d6a8e623c83eb92 /xlib/xgc.c | |
parent | ef6562fba1ee7d08f5cfec0030c94b5364ba90d6 (diff) | |
download | tk-81da7830cb098eaccd1d444a8bd5defa37a25b84.zip tk-81da7830cb098eaccd1d444a8bd5defa37a25b84.tar.gz tk-81da7830cb098eaccd1d444a8bd5defa37a25b84.tar.bz2 |
Bug [f9eddb541a] (TkSetRegion(), XSetClipRectangles): Patch 5 from Christopher Chavez - Implement XSetClipRectangles() on Windows by relocating the existing Aqua implementation
Diffstat (limited to 'xlib/xgc.c')
-rw-r--r-- | xlib/xgc.c | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -432,7 +432,7 @@ XSetClipOrigin( /* *---------------------------------------------------------------------- * - * TkSetRegion, XSetClipMask -- + * TkSetRegion, XSetClipMask, XSetClipRectangles -- * * Sets the clipping region/pixmap for a GC. * @@ -488,6 +488,31 @@ XSetClipMask( return Success; } +int +XSetClipRectangles( + Display* d, + GC gc, + int clip_x_origin, + int clip_y_origin, + XRectangle* rectangles, + int n, + TCL_UNUSED(int)) +{ + TkRegion clipRgn = TkCreateRegion(); + + while (n--) { + XRectangle rect = *rectangles; + + rect.x += clip_x_origin; + rect.y += clip_y_origin; + TkUnionRectWithRegion(&rect, clipRgn, clipRgn); + rectangles++; + } + TkSetRegion(d, gc, clipRgn); + TkDestroyRegion(clipRgn); + return 1; +} + /* * Some additional dummy functions (hopefully implemented soon). */ |