Skip to content
Snippets Groups Projects
Commit 1d83b262 authored by George Nachman's avatar George Nachman
Browse files

Fix a bug where we get drag events outside the window, causing us to try to...

Fix a bug where we get drag events outside the window, causing us to try to look up a line with a bogus index
parent 1895c60d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3350,6 +3350,9 @@ static double EuclideanDistance(NSPoint p1, NSPoint p2) {
NSPoint locationInTextView = [self convertPoint:locationInWindow fromView:nil];
locationInTextView.x = ceil(locationInTextView.x);
locationInTextView.y = ceil(locationInTextView.y);
// Clamp the y position to be within the view. Sometimes we get events we probably shouldn't.
locationInTextView.y = MIN(self.frame.size.height - 1,
MAX(0, locationInTextView.y));
NSRect rectInTextView = [self visibleRect];
int x, y;
int width = [dataSource width];
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment