Unverified Commit f34c2ef0 authored by Tong Mu's avatar Tong Mu Committed by GitHub

Revert "Remove pressure customization from some pointer events (#30414)" (#30873)

This reverts commit a8211369.
parent a8211369
...@@ -315,6 +315,7 @@ class PointerEventConverter { ...@@ -315,6 +315,7 @@ class PointerEventConverter {
position: position, position: position,
buttons: datum.buttons, buttons: datum.buttons,
obscured: datum.obscured, obscured: datum.obscured,
pressure: datum.pressure,
pressureMin: datum.pressureMin, pressureMin: datum.pressureMin,
pressureMax: datum.pressureMax, pressureMax: datum.pressureMax,
distance: datum.distance, distance: datum.distance,
...@@ -336,6 +337,7 @@ class PointerEventConverter { ...@@ -336,6 +337,7 @@ class PointerEventConverter {
position: position, position: position,
buttons: datum.buttons, buttons: datum.buttons,
obscured: datum.obscured, obscured: datum.obscured,
pressure: datum.pressure,
pressureMin: datum.pressureMin, pressureMin: datum.pressureMin,
pressureMax: datum.pressureMax, pressureMax: datum.pressureMax,
distance: datum.distance, distance: datum.distance,
...@@ -362,6 +364,7 @@ class PointerEventConverter { ...@@ -362,6 +364,7 @@ class PointerEventConverter {
position: state.lastPosition, // Change position in Hover position: state.lastPosition, // Change position in Hover
buttons: datum.buttons, buttons: datum.buttons,
obscured: datum.obscured, obscured: datum.obscured,
pressure: datum.pressure,
pressureMin: datum.pressureMin, pressureMin: datum.pressureMin,
pressureMax: datum.pressureMax, pressureMax: datum.pressureMax,
distance: datum.distance, distance: datum.distance,
......
...@@ -354,6 +354,7 @@ class PointerAddedEvent extends PointerEvent { ...@@ -354,6 +354,7 @@ class PointerAddedEvent extends PointerEvent {
int device = 0, int device = 0,
Offset position = Offset.zero, Offset position = Offset.zero,
bool obscured = false, bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0, double pressureMin = 1.0,
double pressureMax = 1.0, double pressureMax = 1.0,
double distance = 0.0, double distance = 0.0,
...@@ -368,7 +369,7 @@ class PointerAddedEvent extends PointerEvent { ...@@ -368,7 +369,7 @@ class PointerAddedEvent extends PointerEvent {
device: device, device: device,
position: position, position: position,
obscured: obscured, obscured: obscured,
pressure: 0.0, pressure: pressure,
pressureMin: pressureMin, pressureMin: pressureMin,
pressureMax: pressureMax, pressureMax: pressureMax,
distance: distance, distance: distance,
...@@ -393,6 +394,7 @@ class PointerRemovedEvent extends PointerEvent { ...@@ -393,6 +394,7 @@ class PointerRemovedEvent extends PointerEvent {
PointerDeviceKind kind = PointerDeviceKind.touch, PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0, int device = 0,
bool obscured = false, bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0, double pressureMin = 1.0,
double pressureMax = 1.0, double pressureMax = 1.0,
double distanceMax = 0.0, double distanceMax = 0.0,
...@@ -404,7 +406,7 @@ class PointerRemovedEvent extends PointerEvent { ...@@ -404,7 +406,7 @@ class PointerRemovedEvent extends PointerEvent {
device: device, device: device,
position: null, position: null,
obscured: obscured, obscured: obscured,
pressure: 0.0, pressure: pressure,
pressureMin: pressureMin, pressureMin: pressureMin,
pressureMax: pressureMax, pressureMax: pressureMax,
distanceMax: distanceMax, distanceMax: distanceMax,
...@@ -435,6 +437,7 @@ class PointerHoverEvent extends PointerEvent { ...@@ -435,6 +437,7 @@ class PointerHoverEvent extends PointerEvent {
Offset delta = Offset.zero, Offset delta = Offset.zero,
int buttons = 0, int buttons = 0,
bool obscured = false, bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0, double pressureMin = 1.0,
double pressureMax = 1.0, double pressureMax = 1.0,
double distance = 0.0, double distance = 0.0,
...@@ -456,7 +459,7 @@ class PointerHoverEvent extends PointerEvent { ...@@ -456,7 +459,7 @@ class PointerHoverEvent extends PointerEvent {
buttons: buttons, buttons: buttons,
down: false, down: false,
obscured: obscured, obscured: obscured,
pressure: 0.0, pressure: pressure,
pressureMin: pressureMin, pressureMin: pressureMin,
pressureMax: pressureMax, pressureMax: pressureMax,
distance: distance, distance: distance,
...@@ -494,6 +497,7 @@ class PointerEnterEvent extends PointerEvent { ...@@ -494,6 +497,7 @@ class PointerEnterEvent extends PointerEvent {
Offset delta = Offset.zero, Offset delta = Offset.zero,
int buttons = 0, int buttons = 0,
bool obscured = false, bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0, double pressureMin = 1.0,
double pressureMax = 1.0, double pressureMax = 1.0,
double distance = 0.0, double distance = 0.0,
...@@ -515,7 +519,7 @@ class PointerEnterEvent extends PointerEvent { ...@@ -515,7 +519,7 @@ class PointerEnterEvent extends PointerEvent {
buttons: buttons, buttons: buttons,
down: false, down: false,
obscured: obscured, obscured: obscured,
pressure: 0.0, pressure: pressure,
pressureMin: pressureMin, pressureMin: pressureMin,
pressureMax: pressureMax, pressureMax: pressureMax,
distance: distance, distance: distance,
...@@ -539,14 +543,16 @@ class PointerEnterEvent extends PointerEvent { ...@@ -539,14 +543,16 @@ class PointerEnterEvent extends PointerEvent {
/// Creates an enter event from a [PointerEvent]. /// Creates an enter event from a [PointerEvent].
/// ///
/// This is used by the [MouseTracker] to synthesize enter events. /// This is used by the [MouseTracker] to synthesize enter events.
PointerEnterEvent.fromMouseEvent(PointerEvent event) : this( PointerEnterEvent.fromMouseEvent(PointerEvent event) : super(
timeStamp: event?.timeStamp, timeStamp: event?.timeStamp,
kind: event?.kind, kind: event?.kind,
device: event?.device, device: event?.device,
position: event?.position, position: event?.position,
delta: event?.delta, delta: event?.delta,
buttons: event?.buttons, buttons: event?.buttons,
down: event?.down,
obscured: event?.obscured, obscured: event?.obscured,
pressure: event?.pressure,
pressureMin: event?.pressureMin, pressureMin: event?.pressureMin,
pressureMax: event?.pressureMax, pressureMax: event?.pressureMax,
distance: event?.distance, distance: event?.distance,
...@@ -584,6 +590,7 @@ class PointerExitEvent extends PointerEvent { ...@@ -584,6 +590,7 @@ class PointerExitEvent extends PointerEvent {
Offset delta = Offset.zero, Offset delta = Offset.zero,
int buttons = 0, int buttons = 0,
bool obscured = false, bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0, double pressureMin = 1.0,
double pressureMax = 1.0, double pressureMax = 1.0,
double distance = 0.0, double distance = 0.0,
...@@ -605,7 +612,7 @@ class PointerExitEvent extends PointerEvent { ...@@ -605,7 +612,7 @@ class PointerExitEvent extends PointerEvent {
buttons: buttons, buttons: buttons,
down: false, down: false,
obscured: obscured, obscured: obscured,
pressure: 0.0, pressure: pressure,
pressureMin: pressureMin, pressureMin: pressureMin,
pressureMax: pressureMax, pressureMax: pressureMax,
distance: distance, distance: distance,
...@@ -629,14 +636,16 @@ class PointerExitEvent extends PointerEvent { ...@@ -629,14 +636,16 @@ class PointerExitEvent extends PointerEvent {
/// Creates an exit event from a [PointerEvent]. /// Creates an exit event from a [PointerEvent].
/// ///
/// This is used by the [MouseTracker] to synthesize exit events. /// This is used by the [MouseTracker] to synthesize exit events.
PointerExitEvent.fromMouseEvent(PointerEvent event) : this( PointerExitEvent.fromMouseEvent(PointerEvent event) : super(
timeStamp: event?.timeStamp, timeStamp: event?.timeStamp,
kind: event?.kind, kind: event?.kind,
device: event?.device, device: event?.device,
position: event?.position, position: event?.position,
delta: event?.delta, delta: event?.delta,
buttons: event?.buttons, buttons: event?.buttons,
down: event?.down,
obscured: event?.obscured, obscured: event?.obscured,
pressure: event?.pressure,
pressureMin: event?.pressureMin, pressureMin: event?.pressureMin,
pressureMax: event?.pressureMax, pressureMax: event?.pressureMax,
distance: event?.distance, distance: event?.distance,
...@@ -773,6 +782,7 @@ class PointerUpEvent extends PointerEvent { ...@@ -773,6 +782,7 @@ class PointerUpEvent extends PointerEvent {
Offset position = Offset.zero, Offset position = Offset.zero,
int buttons = 0, int buttons = 0,
bool obscured = false, bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0, double pressureMin = 1.0,
double pressureMax = 1.0, double pressureMax = 1.0,
double distance = 0.0, double distance = 0.0,
...@@ -793,7 +803,7 @@ class PointerUpEvent extends PointerEvent { ...@@ -793,7 +803,7 @@ class PointerUpEvent extends PointerEvent {
buttons: buttons, buttons: buttons,
down: false, down: false,
obscured: obscured, obscured: obscured,
pressure: 0.0, pressure: pressure,
pressureMin: pressureMin, pressureMin: pressureMin,
pressureMax: pressureMax, pressureMax: pressureMax,
distance: distance, distance: distance,
...@@ -880,6 +890,7 @@ class PointerCancelEvent extends PointerEvent { ...@@ -880,6 +890,7 @@ class PointerCancelEvent extends PointerEvent {
Offset position = Offset.zero, Offset position = Offset.zero,
int buttons = 0, int buttons = 0,
bool obscured = false, bool obscured = false,
double pressure = 0.0,
double pressureMin = 1.0, double pressureMin = 1.0,
double pressureMax = 1.0, double pressureMax = 1.0,
double distance = 0.0, double distance = 0.0,
...@@ -900,7 +911,7 @@ class PointerCancelEvent extends PointerEvent { ...@@ -900,7 +911,7 @@ class PointerCancelEvent extends PointerEvent {
buttons: buttons, buttons: buttons,
down: false, down: false,
obscured: obscured, obscured: obscured,
pressure: 0.0, pressure: pressure,
pressureMin: pressureMin, pressureMin: pressureMin,
pressureMax: pressureMax, pressureMax: pressureMax,
distance: distance, distance: distance,
......
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