Created
February 12, 2014 15:54
-
-
Save bsingr/8958131 to your computer and use it in GitHub Desktop.
Drawing on non-retina devices.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.apple.com/library/ios/documentation/2ddrawing/conceptual/drawingprintingios/graphicsdrawingoverview/graphicsdrawingoverview.html | |
#define ALIGN_POINT_TO_PIXEL(floatValue) ( (((NSInteger) roundf(floatValue)) % 2 == 0) ? floatValue : floatValue + 0.5f ) | |
// Usage: | |
// rect.x = ALIGN_POINT_TO_PIXEL(rect.x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://developer.apple.com/library/ios/documentation/2ddrawing/conceptual/drawingprintingios/graphicsdrawingoverview/graphicsdrawingoverview.html