Fix full-screen drawing issues

This commit fixes a problem where the screen would look blurry, or where
each redraw would cause the entire screen to be cleared before the
redraw (only the Core Text renderer was affected by this bug).
This commit is contained in:
Bjorn Winckler
2009-11-08 17:46:16 +01:00
parent 44b0f3bc30
commit ded90a7def
+7 -3
View File
@@ -308,9 +308,13 @@
- (void)centerView
{
NSRect outer = [self frame], inner = [view frame];
NSPoint origin = NSMakePoint((outer.size.width - inner.size.width)/2,
(outer.size.height - inner.size.height)/2);
// NOTE! Make sure the origin coordinates are integral or very strange
// rendering issues may arise (screen looks blurry, each redraw clears the
// entire window, etc.).
NSPoint origin = { floor((outer.size.width - inner.size.width)/2),
floor((outer.size.height - inner.size.height)/2) };
[view setFrameOrigin:origin];
}