Resize NSView with multiples of 4

With this we should avoid seeing scaled pixels on screen with (e.g.) 3
pixels instead of 2 when Screen Scaling = 200%.
This commit is contained in:
David Capello 2015-10-14 13:11:08 -03:00
parent 9e90061e37
commit 11401e9899

View File

@ -38,8 +38,14 @@ using namespace she;
m_delegate = [[OSXWindowDelegate alloc] initWithWindowImpl:impl];
// The NSView width and height will be a multiple of 4. In this way
// all scaled pixels should be exactly the same
// for Screen Scaling > 1 and <= 4)
self.contentResizeIncrements = NSMakeSize(4, 4);
OSXView* view = [[OSXView alloc] initWithFrame:rect];
[view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self setDelegate:m_delegate];
[self setContentView:view];
[self center];