aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/PlatCocoa.mm
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-19 15:04:38 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-19 15:04:38 +1100
commitdd9ae27be2d1b983638337f24685e6458360dfa3 (patch)
tree3b26625721b6704669c5a6d58d8a1199ad195afe /cocoa/PlatCocoa.mm
parent4b553e8fce75afd0ad0df2e752edafe739db44dc (diff)
downloadscintilla-mirror-dd9ae27be2d1b983638337f24685e6458360dfa3.tar.gz
Implement PopClip to allow local clipping.
Diffstat (limited to 'cocoa/PlatCocoa.mm')
-rw-r--r--cocoa/PlatCocoa.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index b662c25e6..f5f69608e 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -1270,9 +1270,14 @@ XYPOSITION SurfaceImpl::AverageCharWidth(const Font *font_) {
}
void SurfaceImpl::SetClip(PRectangle rc) {
+ CGContextSaveGState(gc);
CGContextClipToRect(gc, PRectangleToCGRect(rc));
}
+void SurfaceImpl::PopClip() {
+ CGContextRestoreGState(gc);
+}
+
void SurfaceImpl::FlushCachedState() {
CGContextSynchronize(gc);
}