Created
September 13, 2013 16:11
-
-
Save bjhomer/6552711 to your computer and use it in GitHub Desktop.
Drawing a 1px line on both 1x and 2x screens.
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
// A 1pt rect along the bottom of the view | |
NSRect bottomLineRect = NSMakeRect(0 , NSHeight(self.bounds) - 1, NSWidth(self.bounds), 1); | |
// Convert to the backing rect, and make sure that it is only 1px tall. | |
NSRect backingRect = [self convertRectToBacking:bottomLineRect]; | |
backingRect.size.height = 1; | |
bottomLineRect = [self convertRectFromBacking:backingRect]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment