Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Delay updating content scales until after notification fires (NSWindo…

…w's backingScaleFactor doesn't update till later, on 10.8 at least). Remove unnecessary if(), if we're updating contentScales, just update all the contentScales.
  • Loading branch information...
commit e19b491475dda06bed4fc2a0bc86c2bb303188a6 1 parent f9d5078
@atebits atebits authored
Showing with 3 additions and 5 deletions.
  1. +1 −1  lib/UIKit/TUINSView.m
  2. +2 −4 lib/UIKit/TUIView+Private.m
View
2  lib/UIKit/TUINSView.m
@@ -203,7 +203,7 @@ - (void)_updateLayerScaleFactor {
- (void)screenProfileOrBackingPropertiesDidChange:(NSNotification *)notification
{
- [self _updateLayerScaleFactor];
+ [self performSelector:@selector(_updateLayerScaleFactor) withObject:nil afterDelay:0.0]; // the window's backingScaleFactor doesn't update until after this notification fires (10.8) - so delay it a bit.
}
- (TUIView *)viewForLocalPoint:(NSPoint)p
View
6 lib/UIKit/TUIView+Private.m
@@ -62,10 +62,8 @@ - (void)_updateLayerScaleFactor
}
if([self.layer respondsToSelector:@selector(setContentsScale:)]) {
- if(fabs(self.layer.contentsScale - scale) > 0.1f) {
- self.layer.contentsScale = scale;
- [self.layer setNeedsDisplay];
- }
+ self.layer.contentsScale = scale;
+ [self setNeedsDisplay];
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.