Created
December 17, 2014 10:16
-
-
Save itsthejb/8b2e704457baee5a59f8 to your computer and use it in GitHub Desktop.
Pixel boundary Quartz drawing macros
This file contains hidden or 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
| #define pixel_points(pixelWidth, scale) (pixelWidth / scale) | |
| #define pixel_offset(pixelWidth, scale) (fmod(pixelWidth, 2) ? 0.5 : 0) | |
| #define pixel_round(pos, offset) (lround(pos) + (lround(pos) > pos ? -offset : +offset)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment