Skip to content

Commit d62829b

Browse files
committed
Fixed content offset updates.
1 parent 36ebc0b commit d62829b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SCXcodeMinimap/SCXcodeMinimapView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ - (void)updateOffset
150150
return;
151151
}
152152

153-
CGPoint offset = NSMakePoint(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification));
154-
[self.scrollView.contentView scrollToPoint:offset];
153+
CGPoint offset = NSMakePoint(0, MAX(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification)));
154+
[self.scrollView.documentView scrollPoint:offset];
155155

156156
CGFloat textHeight = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size.height;
157157
ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight;

0 commit comments

Comments
 (0)