Auto merge of #16498 - paulrouget:scroll_lock, r=jdm

Properly modify scroll_location

As described in #16442, scroll orientation is not locked. `delta` was copied.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16498)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-17 10:54:23 -05:00 committed by GitHub
commit a914409f5e

View file

@ -540,10 +540,10 @@ impl Window {
} }
/// Helper function to send a scroll event. /// 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 // Scroll events snap to the major axis of movement, with vertical
// preferred over horizontal. // 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() { if delta.y.abs() >= delta.x.abs() {
delta.x = 0.0; delta.x = 0.0;
} else { } else {