Skip to content

Commit

Permalink
Properly modify scroll_location
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrouget committed Apr 17, 2017
1 parent 485a4de commit b1ba44a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ports/glutin/window.rs
Expand Up @@ -540,10 +540,10 @@ impl Window {
}

/// Helper function to send a scroll event.
fn scroll_window(&self, scroll_location: ScrollLocation, phase: TouchEventType) {
fn scroll_window(&self, mut scroll_location: ScrollLocation, phase: TouchEventType) {
// Scroll events snap to the major axis of movement, with vertical
// preferred over horizontal.
if let ScrollLocation::Delta(mut delta) = scroll_location {
if let ScrollLocation::Delta(ref mut delta) = scroll_location {
if delta.y.abs() >= delta.x.abs() {
delta.x = 0.0;
} else {
Expand Down

0 comments on commit b1ba44a

Please sign in to comment.