summaryrefslogtreecommitdiff
path: root/src/fl_rect.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-02-04 23:32:53 +0000
committerManolo Gouy <Manolo>2011-02-04 23:32:53 +0000
commit668dfd109f183ad8c4731f7fb8af39977ea89920 (patch)
treef0f1ef1ca07aeb68c97689537355f1300d4ce511 /src/fl_rect.cxx
parent31bbbf7ae60f07d5f87454db0be9e27eea676ded (diff)
Fix STR #2535: clipping + coordinate transformations are now managed separately for each
surface device. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8368 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_rect.cxx')
-rw-r--r--src/fl_rect.cxx16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx
index ea9c10949..703dd82bd 100644
--- a/src/fl_rect.cxx
+++ b/src/fl_rect.cxx
@@ -507,12 +507,6 @@ void Fl_Graphics_Driver::point(int x, int y) {
////////////////////////////////////////////////////////////////
-#define STACK_SIZE 10
-#define STACK_MAX (STACK_SIZE - 1)
-static Fl_Region rstack[STACK_SIZE];
-static int rstackptr=0;
-int fl_clip_state_number=0; // used by gl_begin.cxx to update GL clip
-
#if !defined(WIN32) && !defined(__APPLE__)
// Missing X call: (is this the fastest way to init a 1-rectangle region?)
// MSWindows equivalent exists, implemented inline in win32.H
@@ -526,7 +520,7 @@ Fl_Region XRectangleRegion(int x, int y, int w, int h) {
}
#endif
-void fl_restore_clip() {
+void Fl_Graphics_Driver::restore_clip() {
fl_clip_state_number++;
Fl_Region r = rstack[rstackptr];
#if defined(USE_X11)
@@ -554,14 +548,14 @@ void fl_restore_clip() {
#endif
}
-void fl_clip_region(Fl_Region r) {
+void Fl_Graphics_Driver::clip_region(Fl_Region r) {
Fl_Region oldr = rstack[rstackptr];
if (oldr) XDestroyRegion(oldr);
rstack[rstackptr] = r;
fl_restore_clip();
}
-Fl_Region fl_clip_region() {
+Fl_Region Fl_Graphics_Driver::clip_region() {
return rstack[rstackptr];
}
@@ -596,14 +590,14 @@ void Fl_Graphics_Driver::push_clip(int x, int y, int w, int h) {
# error unsupported platform
#endif
}
- if (rstackptr < STACK_MAX) rstack[++rstackptr] = r;
+ if (rstackptr < REGION_STACK_MAX) rstack[++rstackptr] = r;
else Fl::warning("fl_push_clip: clip stack overflow!\n");
fl_restore_clip();
}
// make there be no clip (used by fl_begin_offscreen() only!)
void Fl_Graphics_Driver::push_no_clip() {
- if (rstackptr < STACK_MAX) rstack[++rstackptr] = 0;
+ if (rstackptr < REGION_STACK_MAX) rstack[++rstackptr] = 0;
else Fl::warning("fl_push_no_clip: clip stack overflow!\n");
fl_restore_clip();
}