Skip to content

Commit

Permalink
Preventing content offset changes while the textStorage is editing (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Jan 31, 2016
1 parent 768ed66 commit 5250eb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SCXcodeMinimap/SCXcodeMinimapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,10 @@ - (void)updateSearchResults

- (void)updateOffset
{
if(self.editorTextView.textStorage.editedMask) {
return;
}

[self.editorTextView.layoutManager ensureLayoutForTextContainer:self.editorTextView.textContainer];

CGFloat editorTextHeight = CGRectGetHeight([self.editorTextView.layoutManager usedRectForTextContainer:self.editorTextView.textContainer]);
Expand All @@ -633,7 +637,7 @@ - (void)updateOffset
[self.selectionView setFrame:selectionViewFrame];
return;
}
CGFloat editorYOffset = CGRectGetMinY(self.editor.scrollView.contentView.bounds) + ABS(CGRectGetMinY(self.editorTextView.frame));

CGFloat ratio = (adjustedMinimapContentHeight / adjustedEditorContentHeight) * (1 / self.scrollView.magnification);
Expand Down

0 comments on commit 5250eb2

Please sign in to comment.