Skip to content

Commit e743424

Browse files
Fixed minimap hiding annotations before toggling visibility.
1 parent 83359dc commit e743424

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
@@ -235,8 +235,10 @@ - (void)viewDidMoveToWindow
235235
if(self.window == nil) {
236236
return;
237237
}
238-
239-
[self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]];
238+
239+
dispatch_async(dispatch_get_main_queue(), ^{
240+
[self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]];
241+
});
240242
}
241243

242244
#pragma mark - Show/Hide
@@ -536,9 +538,10 @@ - (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme
536538
- (void)updateSize
537539
{
538540
CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue];
539-
541+
540542
CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel);
541-
543+
NSLog(@"zoomLevel: %f, minimapWidth: %f", zoomLevel, minimapWidth);
544+
542545
NSRect editorScrollViewFrame = self.editor.scrollView.frame;
543546
editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth;
544547
self.editor.scrollView.frame = editorScrollViewFrame;

0 commit comments

Comments
 (0)