Skip to content

Instantly share code, notes, and snippets.

@bjhomer
Created September 13, 2013 16:11
Show Gist options
  • Save bjhomer/6552711 to your computer and use it in GitHub Desktop.
Save bjhomer/6552711 to your computer and use it in GitHub Desktop.
Drawing a 1px line on both 1x and 2x screens.
// 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