diff options
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/PlatCocoa.h | 1 | ||||
-rw-r--r-- | cocoa/PlatCocoa.mm | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 29a3626ce..1df4e0458 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -105,6 +105,7 @@ public: void RectangleFrame(PRectangle rc, Stroke stroke) override; void FillRectangle(PRectangle rc, ColourDesired back) override; void FillRectangle(PRectangle rc, Fill fill) override; + void FillRectangleAligned(PRectangle rc, Fill fill) override; void FillRectangle(PRectangle rc, Surface &surfacePattern) override; void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) override; void RoundedRectangle(PRectangle rc, FillStroke fillStroke) override; diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 275587288..ef8a3f518 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -811,6 +811,12 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Fill fill) { //-------------------------------------------------------------------------------------------------- +void SurfaceImpl::FillRectangleAligned(PRectangle rc, Fill fill) { + FillRectangle(PixelAlign(rc, PixelDivisions()), fill); +} + +//-------------------------------------------------------------------------------------------------- + static void drawImageRefCallback(void *info, CGContextRef gc) { CGImageRef pattern = static_cast<CGImageRef>(info); CGContextDrawImage(gc, CGRectMake(0, 0, CGImageGetWidth(pattern), CGImageGetHeight(pattern)), pattern); |