summaryrefslogtreecommitdiff
path: root/src/drivers/GDI
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-30 20:16:40 +0000
committerManolo Gouy <Manolo>2016-03-30 20:16:40 +0000
commitd67f395031b0e9cfb266bf31a4a5e08a2d109e3b (patch)
tree6a38b9180802e79b16af5de3ff031e6d739ac16c /src/drivers/GDI
parent7799245100a91b10b9a4ca9c6e818a3cdd8d5dc9 (diff)
Rewrite functions XRectangleRegion(), XDestroyRegion() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index 54740fc10..f03c38940 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -166,6 +166,18 @@ void Fl_GDI_Graphics_Driver::fixloop() { // remove equal points from closed pat
while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--;
}
+Fl_Region Fl_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) {
+ if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) return CreateRectRgn(x,y,x+w,y+h);
+ // because rotation may apply, the rectangle becomes a polygon in device coords
+ POINT pt[4] = { {x, y}, {x + w, y}, {x + w, y + h}, {x, y + h} };
+ LPtoDP((HDC)fl_graphics_driver->gc(), pt, 4);
+ return CreatePolygonRgn(pt, 4, ALTERNATE);
+}
+
+void Fl_Graphics_Driver::XDestroyRegion(Fl_Region r) {
+ DeleteObject(r);
+}
+
//
// End of "$Id$".