diff options
Diffstat (limited to 'gtk')
-rwxr-xr-x | gtk/PlatGTK.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 33a0b8917..3b19df3ba 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -136,6 +136,7 @@ class SurfaceImpl : public Surface { Converter conv; int characterSet; void SetConverter(int characterSet_); + void CairoRectangle(PRectangle rc); public: SurfaceImpl() noexcept; // Deleted so SurfaceImpl objects can not be copied. @@ -186,6 +187,7 @@ public: XYPOSITION AverageCharWidth(const Font *font_) override; void SetClip(PRectangle rc) override; + void PopClip() override; void FlushCachedState() override; void SetUnicodeMode(bool unicodeMode_) override; @@ -257,6 +259,10 @@ void SurfaceImpl::SetConverter(int characterSet_) { } } +void SurfaceImpl::CairoRectangle(PRectangle rc) { + cairo_rectangle(context, rc.left, rc.top, rc.Width(), rc.Height()); +} + SurfaceImpl::SurfaceImpl() noexcept : et(singleByte), context(nullptr), psurf(nullptr), @@ -950,10 +956,16 @@ XYPOSITION SurfaceImpl::AverageCharWidth(const Font *font_) { void SurfaceImpl::SetClip(PRectangle rc) { PLATFORM_ASSERT(context); - cairo_rectangle(context, rc.left, rc.top, rc.Width(), rc.Height()); + cairo_save(context); + CairoRectangle(rc); cairo_clip(context); } +void SurfaceImpl::PopClip() { + PLATFORM_ASSERT(context); + cairo_restore(context); +} + void SurfaceImpl::FlushCachedState() {} void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) { |