mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add tangentialPressure property to PointerEvent interface
Summary: Changelog: [iOS][internal] - Add tangentialPressure property to PointerEvent interface This diff adds the tangentialPressure property to the PointerEvent implementation on iOS. This one is pretty simple considering iOS doesn't have the concept of tangential pressure so we just hard code it to 0 as defined by the spec. Reviewed By: lunaleaps Differential Revision: D37759634 fbshipit-source-id: 7ca0e47267f5fde76ace2b96d05ea2e154cb4b8f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d82cd3cbce
commit
3cc335e615
@@ -279,6 +279,8 @@ static PointerEvent CreatePointerEventFromActiveTouch(ActiveTouch activeTouch, R
|
||||
event.buttons = 0;
|
||||
}
|
||||
|
||||
event.tangentialPressure = 0.0;
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
@@ -299,6 +301,7 @@ CreatePointerEventFromIncompleteHoverData(UIView *view, CGPoint clientLocation,
|
||||
event.tiltY = 0;
|
||||
event.detail = 0;
|
||||
event.buttons = 0;
|
||||
event.tangentialPressure = 0.0;
|
||||
return event;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ std::vector<DebugStringConvertibleObject> getDebugProps(
|
||||
{"tiltY", getDebugDescription(pointerEvent.tiltY, options)},
|
||||
{"detail", getDebugDescription(pointerEvent.detail, options)},
|
||||
{"buttons", getDebugDescription(pointerEvent.buttons, options)},
|
||||
{"tangentialPressure",
|
||||
getDebugDescription(pointerEvent.tangentialPressure, options)},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ struct PointerEvent {
|
||||
* the X axis.
|
||||
*/
|
||||
int tiltY;
|
||||
/**
|
||||
/*
|
||||
* Returns a long with details about the event, depending on the event type.
|
||||
*/
|
||||
int detail;
|
||||
@@ -64,6 +64,12 @@ struct PointerEvent {
|
||||
* The buttons being depressed (if any) when the mouse event was fired.
|
||||
*/
|
||||
int buttons;
|
||||
/*
|
||||
* The normalized tangential pressure of the pointer input (also known as
|
||||
* barrel pressure or cylinder stress) in the range -1 to 1, where 0 is the
|
||||
* neutral position of the control.
|
||||
*/
|
||||
Float tangentialPressure;
|
||||
};
|
||||
|
||||
#if RN_DEBUG_STRING_CONVERTIBLE
|
||||
|
||||
@@ -74,6 +74,7 @@ static jsi::Value pointerEventPayload(
|
||||
object.setProperty(runtime, "tiltY", event.tiltY);
|
||||
object.setProperty(runtime, "detail", event.detail);
|
||||
object.setProperty(runtime, "buttons", event.buttons);
|
||||
object.setProperty(runtime, "tangentialPressure", event.tangentialPressure);
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user