Skip to content
Snippets Groups Projects
Commit bd00c3f7 authored by Jack Chen (chendo)'s avatar Jack Chen (chendo)
Browse files

Scrolling with wheel should always scroll at least one line

parent 445e3629
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -168,11 +168,18 @@
PTYScroller *verticalScroller = (PTYScroller *)[self verticalScroller];
NSRect scrollRect;
 
scrollRect= [self documentVisibleRect];
scrollRect.origin.y-=[theEvent deltaY] * [self verticalLineScroll];
scrollRect = [self documentVisibleRect];
double delta = [theEvent deltaY];
if (delta > 0 && delta < 1)
delta = 1;
if (delta < 0 && delta > -1)
delta = -1;
scrollRect.origin.y -= delta * [self verticalLineScroll];
[[self documentView] scrollRectToVisible: scrollRect];
 
scrollRect= [self documentVisibleRect];
scrollRect = [self documentVisibleRect];
if(scrollRect.origin.y+scrollRect.size.height < [[self documentView] frame].size.height)
[verticalScroller setUserScroll: YES];
else
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