| 1014 | jlong ValdiAndroid::NativeBridge::getViewNodePoint( // NOLINT |
| 1015 | fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT |
| 1016 | jlong runtimeHandle, |
| 1017 | jlong viewNodeHandle, |
| 1018 | jint x, |
| 1019 | jint y, |
| 1020 | jint mode, |
| 1021 | jboolean fromBoundsOrigin) { |
| 1022 | static constexpr jint kModeDirectionAgnosticRelative = 1; |
| 1023 | static constexpr jint kModeDirectionAgnosticAbsolute = 2; |
| 1024 | static constexpr jint kModeVisualRelative = 3; |
| 1025 | static constexpr jint kModeVisualAbsolute = 4; |
| 1026 | static constexpr jint kModeViewportRelative = 5; |
| 1027 | static constexpr jint kModeViewportAbsolute = 6; |
| 1028 | |
| 1029 | auto* runtimeWrapper = getRuntimeWrapper(runtimeHandle); |
| 1030 | auto viewNode = getViewNode(viewNodeHandle); |
| 1031 | if (viewNode == nullptr || runtimeWrapper == nullptr) { |
| 1032 | return 0; |
| 1033 | } |
| 1034 | |
| 1035 | auto pointScale = runtimeWrapper->getPointScale(); |
| 1036 | |
| 1037 | Valdi::Point input = Valdi::Point(Valdi::pixelsToPoints(static_cast<int32_t>(x), pointScale), |
| 1038 | Valdi::pixelsToPoints(static_cast<int32_t>(y), pointScale)); |
| 1039 | |
| 1040 | if (static_cast<bool>(fromBoundsOrigin)) { |
| 1041 | input = input.withOffset(viewNode->getBoundsOriginPoint()); |
| 1042 | } |
| 1043 | |
| 1044 | Valdi::Point output; |
| 1045 | |
| 1046 | if (mode == kModeDirectionAgnosticRelative) { |
nothing calls this directly
no test coverage detected