Skip to content

Commit d6095c4

Browse files
committed
Fixes the selection view frame when the document and the scrollView heights are equal.
1 parent 6349e76 commit d6095c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SCXcodeMinimap/SCXcodeMinimapView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ - (void)updateOffset
167167
return;
168168
}
169169

170-
CGFloat ratio = (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification);
170+
CGFloat ratio = (MAX(CGRectGetHeight(self.scrollView.bounds) , (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds))) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification);
171171

172172
if(ratio == 0.0f) {
173173
[self.selectionView setFrame:selectionViewFrame];

0 commit comments

Comments
 (0)