Closed nangtrongvuon closed 5 years ago
Very cool, will review this later today!
So CI is failing because of an issue with a search test? I'm not sure what's up with that, but it might be due to some change in xi-editor
. Maybe change this PR to only include the scroll change, and not update the submodule, and then we can look at the other problem separately?
In any case if you do that change feel free to merge on green!
Summary
This fixes an issue where the
scroll(to: NSPoint)
usage in xi-mac's case only supports smooth scrolling and thus doesn't properly take into account notched mouse wheel scroll (which usually means external mice).Smooth scrolling (like the MacBook trackpad or Apple Magic Mouse) sends scrollEvents that are chunked, continuous and cumulative, and thus the scroll view's
clipView
's bounds is set properly for each of these small chunks of scrolling.Scrolling with notched mice scrolls in discrete units, takes into account acceleration but does not redraw the view when the view is continuously redrawn during scrolling - this is because the bounds origin is only set after the scrolling has stopped completely, causing the janky scroll that is described in #411. This is likely a bug/oversight on Apple's part.
This PR simply sets the
clipView
's bound origin properly on all scrolling.closes #411.
Review Checklist