summaryrefslogtreecommitdiff
path: root/src/Fl_Graphics_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <manolo>2018-12-04 15:11:03 +0100
committerManoloFLTK <manolo>2018-12-04 15:11:03 +0100
commitd2870d6f7d378e374da515280e9434c605b1ac4e (patch)
treebf7a5a45d5919088b695a99195c72ccdd3ef6f87 /src/Fl_Graphics_Driver.cxx
parentb985b884f88d8b9c9b000dbfd564a220ceb7b7ed (diff)
Define useful implementations of Fl_Graphics_Driver::push_no_clip() and pop_clip().
Diffstat (limited to 'src/Fl_Graphics_Driver.cxx')
-rw-r--r--src/Fl_Graphics_Driver.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx
index 9de99b4ee..784e5b5c2 100644
--- a/src/Fl_Graphics_Driver.cxx
+++ b/src/Fl_Graphics_Driver.cxx
@@ -385,6 +385,20 @@ void Fl_Graphics_Driver::polygon(int x0, int y0, int x1, int y1, int x2, int y2,
polygon(x1, y1, x2, y2, x3, y3);
}
+void Fl_Graphics_Driver::push_no_clip() {
+ if (rstackptr < region_stack_max) rstack[++rstackptr] = 0;
+ else Fl::warning("Fl_Graphics_Driver::push_no_clip: clip stack overflow!\n");
+ restore_clip();
+}
+
+void Fl_Graphics_Driver::pop_clip() {
+ if (rstackptr > 0) {
+ Fl_Region oldr = rstack[rstackptr--];
+ if (oldr) XDestroyRegion(oldr);
+ } else Fl::warning("Fl_Graphics_Driver::pop_clip: clip stack underflow!\n");
+ restore_clip();
+}
+
/**
\}
\endcond