aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/PlatCocoa.h1
-rw-r--r--cocoa/PlatCocoa.mm18
2 files changed, 19 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h
index 4487d9945..36022286c 100644
--- a/cocoa/PlatCocoa.h
+++ b/cocoa/PlatCocoa.h
@@ -100,6 +100,7 @@ public:
void Polygon(const Scintilla::Point *pts, size_t npts, FillStroke fillStroke) override;
void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) override;
void RectangleDraw(PRectangle rc, FillStroke fillStroke) override;
+ void RectangleFrame(PRectangle rc, Stroke stroke) override;
void FillRectangle(PRectangle rc, ColourDesired back) override;
void FillRectangle(PRectangle rc, Fill fill) override;
void FillRectangle(PRectangle rc, Surface &surfacePattern) override;
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);