Skip to content

Commit

Permalink
Remove pressure customization from some pointer events (flutter#30414)
Browse files Browse the repository at this point in the history
* Remove pressure from PointerHoverEvent ctor
  • Loading branch information
dkwingsmt authored Apr 10, 2019
1 parent 316d449 commit a821136
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
3 changes: 0 additions & 3 deletions packages/flutter/lib/src/gestures/converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ class PointerEventConverter {
position: position,
buttons: datum.buttons,
obscured: datum.obscured,
pressure: datum.pressure,
pressureMin: datum.pressureMin,
pressureMax: datum.pressureMax,
distance: datum.distance,
Expand All @@ -337,7 +336,6 @@ class PointerEventConverter {
position: position,
buttons: datum.buttons,
obscured: datum.obscured,
pressure: datum.pressure,
pressureMin: datum.pressureMin,
pressureMax: datum.pressureMax,
distance: datum.distance,
Expand All @@ -364,7 +362,6 @@ class PointerEventConverter {
position: state.lastPosition, // Change position in Hover
buttons: datum.buttons,
obscured: datum.obscured,
pressure: datum.pressure,
pressureMin: datum.pressureMin,
pressureMax: datum.pressureMax,
distance: datum.distance,
Expand Down
29 changes: 9 additions & 20 deletions packages/flutter/lib/src/gestures/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ class PointerAddedEvent extends PointerEvent {
int device = 0,
Offset position = Offset.zero,
bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
Expand All @@ -369,7 +368,7 @@ class PointerAddedEvent extends PointerEvent {
device: device,
position: position,
obscured: obscured,
pressure: pressure,
pressure: 0.0,
pressureMin: pressureMin,
pressureMax: pressureMax,
distance: distance,
Expand All @@ -394,7 +393,6 @@ class PointerRemovedEvent extends PointerEvent {
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distanceMax = 0.0,
Expand All @@ -406,7 +404,7 @@ class PointerRemovedEvent extends PointerEvent {
device: device,
position: null,
obscured: obscured,
pressure: pressure,
pressure: 0.0,
pressureMin: pressureMin,
pressureMax: pressureMax,
distanceMax: distanceMax,
Expand Down Expand Up @@ -437,7 +435,6 @@ class PointerHoverEvent extends PointerEvent {
Offset delta = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
Expand All @@ -459,7 +456,7 @@ class PointerHoverEvent extends PointerEvent {
buttons: buttons,
down: false,
obscured: obscured,
pressure: pressure,
pressure: 0.0,
pressureMin: pressureMin,
pressureMax: pressureMax,
distance: distance,
Expand Down Expand Up @@ -497,7 +494,6 @@ class PointerEnterEvent extends PointerEvent {
Offset delta = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
Expand All @@ -519,7 +515,7 @@ class PointerEnterEvent extends PointerEvent {
buttons: buttons,
down: false,
obscured: obscured,
pressure: pressure,
pressure: 0.0,
pressureMin: pressureMin,
pressureMax: pressureMax,
distance: distance,
Expand All @@ -543,16 +539,14 @@ class PointerEnterEvent extends PointerEvent {
/// Creates an enter event from a [PointerEvent].
///
/// This is used by the [MouseTracker] to synthesize enter events.
PointerEnterEvent.fromMouseEvent(PointerEvent event) : super(
PointerEnterEvent.fromMouseEvent(PointerEvent event) : this(
timeStamp: event?.timeStamp,
kind: event?.kind,
device: event?.device,
position: event?.position,
delta: event?.delta,
buttons: event?.buttons,
down: event?.down,
obscured: event?.obscured,
pressure: event?.pressure,
pressureMin: event?.pressureMin,
pressureMax: event?.pressureMax,
distance: event?.distance,
Expand Down Expand Up @@ -590,7 +584,6 @@ class PointerExitEvent extends PointerEvent {
Offset delta = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
Expand All @@ -612,7 +605,7 @@ class PointerExitEvent extends PointerEvent {
buttons: buttons,
down: false,
obscured: obscured,
pressure: pressure,
pressure: 0.0,
pressureMin: pressureMin,
pressureMax: pressureMax,
distance: distance,
Expand All @@ -636,16 +629,14 @@ class PointerExitEvent extends PointerEvent {
/// Creates an exit event from a [PointerEvent].
///
/// This is used by the [MouseTracker] to synthesize exit events.
PointerExitEvent.fromMouseEvent(PointerEvent event) : super(
PointerExitEvent.fromMouseEvent(PointerEvent event) : this(
timeStamp: event?.timeStamp,
kind: event?.kind,
device: event?.device,
position: event?.position,
delta: event?.delta,
buttons: event?.buttons,
down: event?.down,
obscured: event?.obscured,
pressure: event?.pressure,
pressureMin: event?.pressureMin,
pressureMax: event?.pressureMax,
distance: event?.distance,
Expand Down Expand Up @@ -782,7 +773,6 @@ class PointerUpEvent extends PointerEvent {
Offset position = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
Expand All @@ -803,7 +793,7 @@ class PointerUpEvent extends PointerEvent {
buttons: buttons,
down: false,
obscured: obscured,
pressure: pressure,
pressure: 0.0,
pressureMin: pressureMin,
pressureMax: pressureMax,
distance: distance,
Expand Down Expand Up @@ -890,7 +880,6 @@ class PointerCancelEvent extends PointerEvent {
Offset position = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
Expand All @@ -911,7 +900,7 @@ class PointerCancelEvent extends PointerEvent {
buttons: buttons,
down: false,
obscured: obscured,
pressure: pressure,
pressure: 0.0,
pressureMin: pressureMin,
pressureMax: pressureMax,
distance: distance,
Expand Down

0 comments on commit a821136

Please sign in to comment.