diff options
Diffstat (limited to 'cocoa/PlatCocoa.mm')
-rw-r--r-- | cocoa/PlatCocoa.mm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index f84a335aa..a4f01c5c6 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -479,6 +479,17 @@ void SurfaceImpl::PenColour(ColourDesired fore) { //-------------------------------------------------------------------------------------------------- +void SurfaceImpl::FillColour(ColourAlpha fill) { + // Set the Fill color to match + CGContextSetRGBFillColor(gc, + fill.GetRedComponent(), + fill.GetGreenComponent(), + fill.GetBlueComponent(), + fill.GetAlphaComponent()); +} + +//-------------------------------------------------------------------------------------------------- + void SurfaceImpl::FillColour(const ColourDesired &back) { if (gc) { ColourDesired colour(back.AsInteger()); @@ -662,6 +673,16 @@ void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) { //-------------------------------------------------------------------------------------------------- +void SurfaceImpl::FillRectangle(PRectangle rc, Fill fill) { + if (gc) { + FillColour(fill.colour); + CGRect rect = PRectangleToCGRect(rc); + CGContextFillRect(gc, rect); + } +} + +//-------------------------------------------------------------------------------------------------- + static void drawImageRefCallback(void *info, CGContextRef gc) { CGImageRef pattern = static_cast<CGImageRef>(info); CGContextDrawImage(gc, CGRectMake(0, 0, CGImageGetWidth(pattern), CGImageGetHeight(pattern)), pattern); |