From d2870d6f7d378e374da515280e9434c605b1ac4e Mon Sep 17 00:00:00 2001 From: ManoloFLTK Date: Tue, 4 Dec 2018 15:11:03 +0100 Subject: Define useful implementations of Fl_Graphics_Driver::push_no_clip() and pop_clip(). --- src/Fl_Graphics_Driver.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Fl_Graphics_Driver.cxx') 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 -- cgit v1.2.3