Commit ccc98c8f authored by Adam Barth's avatar Adam Barth

The dx and dy properties of PointerInputEvents shouldn't be null

They should be 0.0 when there's no offset.

Fixes #1661
parent 284eaa9c
...@@ -20,28 +20,28 @@ class PointerInputEvent extends InputEvent { ...@@ -20,28 +20,28 @@ class PointerInputEvent extends InputEvent {
const PointerInputEvent({ const PointerInputEvent({
String type, String type,
double timeStamp: 0.0, double timeStamp: 0.0,
this.pointer, this.pointer: 0,
this.kind, this.kind,
this.x, this.x: 0.0,
this.y, this.y: 0.0,
this.dx, this.dx: 0.0,
this.dy, this.dy: 0.0,
this.buttons, this.buttons: 0,
this.down, this.down: false,
this.primary, this.primary: false,
this.obscured, this.obscured: false,
this.pressure, this.pressure: 0.0,
this.pressureMin, this.pressureMin: 0.0,
this.pressureMax, this.pressureMax: 0.0,
this.distance, this.distance: 0.0,
this.distanceMin, this.distanceMin: 0.0,
this.distanceMax, this.distanceMax: 0.0,
this.radiusMajor, this.radiusMajor: 0.0,
this.radiusMinor, this.radiusMinor: 0.0,
this.radiusMin, this.radiusMin: 0.0,
this.radiusMax, this.radiusMax: 0.0,
this.orientation, this.orientation: 0.0,
this.tilt this.tilt: 0.0
}) : super(type: type, timeStamp: timeStamp); }) : super(type: type, timeStamp: timeStamp);
final int pointer; final int pointer;
......
...@@ -62,7 +62,8 @@ class _UiEventConverter { ...@@ -62,7 +62,8 @@ class _UiEventConverter {
Point position = new Point(event.x, event.y); Point position = new Point(event.x, event.y);
_PointerState state = _stateForPointer[event.pointer]; _PointerState state = _stateForPointer[event.pointer];
double dx, dy; double dx = 0.0;
double dy = 0.0;
switch (event.type) { switch (event.type) {
case 'pointerdown': case 'pointerdown':
if (state == null) { if (state == null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment