diff --git a/Source/CWGraphicsFoundation.m b/Source/CWGraphicsFoundation.m index 4186d5b..11aa128 100644 --- a/Source/CWGraphicsFoundation.m +++ b/Source/CWGraphicsFoundation.m @@ -29,15 +29,6 @@ of this software and associated documentation files (the "Software"), to deal #import "CWGraphicsFoundation.h" -CGRect CWCenteredRect(CGRect smallRect, CGRect largeRect) -{ - CGRect centeredRect; - centeredRect.size = smallRect.size; - centeredRect.origin.x = (largeRect.size.width - smallRect.size.width) / 2.0; - centeredRect.origin.y = (largeRect.size.height - smallRect.size.height) / 2.0; - return centeredRect; -} - /** Easy way to return the CGContextRef inside a NSView */ @@ -50,6 +41,15 @@ inline CGContextRef CWCurrentCGContext() #endif } +CGRect CWCenteredRect(CGRect smallRect, CGRect largeRect) +{ + CGRect centeredRect; + centeredRect.size = smallRect.size; + centeredRect.origin.x = (largeRect.size.width - smallRect.size.width) * 0.5; + centeredRect.origin.y = (largeRect.size.height - smallRect.size.height) * 0.5; + return centeredRect; +} + /** Adds a rounded rect path to a CGContextRef */