mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8cf57a5bdd
Summary: Changelog: [iOS][Internal] Add width/height properties to the PointerEvent object Reviewed By: kacieb Differential Revision: D37116854 fbshipit-source-id: 686266d480bb2ee1d2b6696d80ad42865fa2111c
60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <react/renderer/core/ReactPrimitives.h>
|
|
#include <react/renderer/debug/DebugStringConvertible.h>
|
|
#include <react/renderer/graphics/Geometry.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
struct PointerEvent {
|
|
/*
|
|
* A unique identifier for the pointer causing the event.
|
|
*/
|
|
int pointerId;
|
|
/*
|
|
* The normalized pressure of the pointer input in the range 0 to 1, where 0
|
|
* and 1 represent the minimum and maximum pressure the hardware is capable of
|
|
* detecting, respectively.
|
|
*/
|
|
Float pressure;
|
|
/*
|
|
* Indicates the device type that caused the event (mouse, pen, touch, etc.)
|
|
*/
|
|
std::string pointerType;
|
|
/*
|
|
* Point within the application's viewport at which the event occurred (as
|
|
* opposed to the coordinate within the page).
|
|
*/
|
|
Point clientPoint;
|
|
/*
|
|
* The width (magnitude on the X axis), in CSS pixels, of the contact geometry
|
|
* of the pointer
|
|
*/
|
|
Float width;
|
|
/*
|
|
* The height (magnitude on the y axis), in CSS pixels, of the contact
|
|
* geometry of the pointer
|
|
*/
|
|
Float height;
|
|
};
|
|
|
|
#if RN_DEBUG_STRING_CONVERTIBLE
|
|
|
|
std::string getDebugName(PointerEvent const &pointerEvent);
|
|
std::vector<DebugStringConvertibleObject> getDebugProps(
|
|
PointerEvent const &pointerEvent,
|
|
DebugStringConvertibleOptions options);
|
|
|
|
#endif
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|