summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-04-25 17:05:17 +0000
committerManolo Gouy <Manolo>2017-04-25 17:05:17 +0000
commit18a84d073dd67f81685611739c588441e3b881ea (patch)
treec1f2112addba6298d13e6b8e6d2b5db1466164d1 /src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
parent2ddc89fb6167b9c28795a20318576a98783e6c46 (diff)
Remove Fl_Translated_GDI_Graphics_Driver and have its functions performed by Fl_GDI_Graphics_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12227 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index 1ba2a198a..6649e3f3d 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -3,7 +3,7 @@
//
// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 1998-2017 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -134,19 +134,27 @@ void Fl_GDI_Graphics_Driver::copy_offscreen_with_alpha(int x,int y,int w,int h,H
RestoreDC(new_gc, save);
DeleteDC(new_gc);
}
-#endif
-void Fl_Translated_GDI_Graphics_Driver::translate_all(int x, int y) {
+void Fl_GDI_Graphics_Driver::translate_all(int x, int y) {
+ const int stack_height = 10;
+ if (depth == -1) {
+ origins = new POINT[stack_height];
+ depth = 0;
+ }
+ if (depth >= stack_height) {
+ Fl::warning("Fl_Copy/Image_Surface: translate stack overflow!");
+ depth = stack_height - 1;
+ }
GetWindowOrgEx((HDC)gc(), origins+depth);
SetWindowOrgEx((HDC)gc(), origins[depth].x - x, origins[depth].y - y, NULL);
- if (depth < sizeof(origins)/sizeof(POINT)) depth++;
- else Fl::warning("Fl_Copy_Surface: translate stack overflow!");
+ depth++;
}
-void Fl_Translated_GDI_Graphics_Driver::untranslate_all() {
+void Fl_GDI_Graphics_Driver::untranslate_all() {
if (depth > 0) depth--;
SetWindowOrgEx((HDC)gc(), origins[depth].x, origins[depth].y, NULL);
}
+#endif
void Fl_GDI_Graphics_Driver::add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H) {
Fl_Region R = XRectangleRegion(X, Y, W, H);