aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/PlatCocoa.mm
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-20 09:24:43 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-20 09:24:43 +1100
commit6c56011f882cdfa758898029be5cabe82fc9228c (patch)
tree7b9720ac901dcaa37a7d93035d34b5c9bd536897 /cocoa/PlatCocoa.mm
parent6ca286d41a1ca8e6d948d131fdaaf8b8199c905e (diff)
downloadscintilla-mirror-6c56011f882cdfa758898029be5cabe82fc9228c.tar.gz
Implement RectangleFrame.
Diffstat (limited to 'cocoa/PlatCocoa.mm')
-rw-r--r--cocoa/PlatCocoa.mm18
1 files changed, 18 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 618d17de1..55a6ee620 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -737,6 +737,24 @@ void SurfaceImpl::RectangleDraw(PRectangle rc, FillStroke fillStroke) {
//--------------------------------------------------------------------------------------------------
+void SurfaceImpl::RectangleFrame(PRectangle rc, Stroke stroke) {
+ if (!gc)
+ return;
+
+ CGContextBeginPath(gc);
+ PenColourAlpha(stroke.colour);
+ CGContextSetLineWidth(gc, stroke.width);
+
+ CGContextAddRect(gc, CGRectFromPRectangleInset(rc, stroke.width));
+
+ CGContextDrawPath(gc, kCGPathStroke);
+
+ // Restore as not all paths set
+ CGContextSetLineWidth(gc, 1.0f);
+}
+
+//--------------------------------------------------------------------------------------------------
+
void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) {
if (gc) {
FillColour(back);