The dx and dy properties of PointerInputEvents shouldn't be null
They should be 0.0 when there's no offset. Fixes #1661
This commit is contained in:
parent
284eaa9cd7
commit
ccc98c8f41
@ -20,28 +20,28 @@ class PointerInputEvent extends InputEvent {
|
||||
const PointerInputEvent({
|
||||
String type,
|
||||
double timeStamp: 0.0,
|
||||
this.pointer,
|
||||
this.pointer: 0,
|
||||
this.kind,
|
||||
this.x,
|
||||
this.y,
|
||||
this.dx,
|
||||
this.dy,
|
||||
this.buttons,
|
||||
this.down,
|
||||
this.primary,
|
||||
this.obscured,
|
||||
this.pressure,
|
||||
this.pressureMin,
|
||||
this.pressureMax,
|
||||
this.distance,
|
||||
this.distanceMin,
|
||||
this.distanceMax,
|
||||
this.radiusMajor,
|
||||
this.radiusMinor,
|
||||
this.radiusMin,
|
||||
this.radiusMax,
|
||||
this.orientation,
|
||||
this.tilt
|
||||
this.x: 0.0,
|
||||
this.y: 0.0,
|
||||
this.dx: 0.0,
|
||||
this.dy: 0.0,
|
||||
this.buttons: 0,
|
||||
this.down: false,
|
||||
this.primary: false,
|
||||
this.obscured: false,
|
||||
this.pressure: 0.0,
|
||||
this.pressureMin: 0.0,
|
||||
this.pressureMax: 0.0,
|
||||
this.distance: 0.0,
|
||||
this.distanceMin: 0.0,
|
||||
this.distanceMax: 0.0,
|
||||
this.radiusMajor: 0.0,
|
||||
this.radiusMinor: 0.0,
|
||||
this.radiusMin: 0.0,
|
||||
this.radiusMax: 0.0,
|
||||
this.orientation: 0.0,
|
||||
this.tilt: 0.0
|
||||
}) : super(type: type, timeStamp: timeStamp);
|
||||
|
||||
final int pointer;
|
||||
|
@ -62,7 +62,8 @@ class _UiEventConverter {
|
||||
Point position = new Point(event.x, event.y);
|
||||
|
||||
_PointerState state = _stateForPointer[event.pointer];
|
||||
double dx, dy;
|
||||
double dx = 0.0;
|
||||
double dy = 0.0;
|
||||
switch (event.type) {
|
||||
case 'pointerdown':
|
||||
if (state == null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user