| 1147 | jint height, |
| 1148 | jboolean isRTL) { |
| 1149 | auto viewNodeTree = getViewNodeTree(contextHandle); |
| 1150 | auto* runtimeWrapper = getRuntimeWrapper(runtimeHandle); |
| 1151 | |
| 1152 | if (viewNodeTree == nullptr || runtimeWrapper == nullptr) { |
| 1153 | return; |
| 1154 | } |
| 1155 | |
| 1156 | auto widthFloat = static_cast<float>(width) / runtimeWrapper->getPointScale(); |
| 1157 | auto heightFloat = static_cast<float>(height) / runtimeWrapper->getPointScale(); |
| 1158 | auto layoutDirection = static_cast<bool>(isRTL) ? Valdi::LayoutDirectionRTL : Valdi::LayoutDirectionLTR; |
| 1159 | |
| 1160 | viewNodeTree->setLayoutSpecs(Valdi::Size(widthFloat, heightFloat), layoutDirection); |
| 1161 | } |
| 1162 | |
| 1163 | void ValdiAndroid::NativeBridge::setVisibleViewport( // NOLINT |
| 1164 | fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT |
| 1165 | jlong runtimeHandle, |
| 1166 | jlong contextHandle, |
| 1167 | jint x, |
| 1168 | jint y, |
| 1169 | jint width, |
| 1170 | jint height, |
| 1171 | jboolean shouldUnset) { |
| 1172 | auto viewNodeTree = getViewNodeTree(contextHandle); |
| 1173 | auto* runtimeWrapper = getRuntimeWrapper(runtimeHandle); |
| 1174 | |
| 1175 | if (viewNodeTree == nullptr || runtimeWrapper == nullptr) { |
| 1176 | return; |
| 1177 | } |
| 1178 | |
| 1179 | if (static_cast<bool>(shouldUnset)) { |
nothing calls this directly
no test coverage detected