Skip to content

Commit 5da6fa6

Browse files
committed
Merge branch 'fix-warning-under-sidebar' of https://github.com/richardjrossiii/SCXcodeMiniMap into richardjrossiii-fix-warning-under-sidebar
2 parents f42aacc + e743424 commit 5da6fa6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

SCXcodeMinimap/SCXcodeMinimapView.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ - (void)viewDidMoveToWindow
251251
if(self.window == nil) {
252252
return;
253253
}
254-
255-
[self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]];
254+
255+
dispatch_async(dispatch_get_main_queue(), ^{
256+
[self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]];
257+
});
256258
}
257259

258260
#pragma mark - Show/Hide
@@ -612,9 +614,10 @@ - (void)updateTheme
612614
- (void)updateSize
613615
{
614616
CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue];
615-
617+
616618
CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel);
617-
619+
NSLog(@"zoomLevel: %f, minimapWidth: %f", zoomLevel, minimapWidth);
620+
618621
NSRect editorScrollViewFrame = self.editor.scrollView.frame;
619622
editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth;
620623
self.editor.scrollView.frame = editorScrollViewFrame;

0 commit comments

Comments
 (0)