mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 14:48:25 +00:00
Cleanup measure function
Summary: Trivial diff that cleans up measure function in C++ and Android Reviewed By: shergin Differential Revision: D13200340 fbshipit-source-id: 6c0888439640241cdedf514898a1ba3dac231d6a
This commit is contained in:
parent
a2ead1c7b5
commit
3c50d04cf2
@ -36,8 +36,10 @@ void ParagraphShadowNode::updateLocalDataIfNeeded() {
|
||||
ensureUnsealed();
|
||||
|
||||
auto attributedString = getAttributedString();
|
||||
auto currentLocalData = std::static_pointer_cast<const ParagraphLocalData>(getLocalData());
|
||||
if (currentLocalData && currentLocalData->getAttributedString() == attributedString) {
|
||||
auto currentLocalData =
|
||||
std::static_pointer_cast<const ParagraphLocalData>(getLocalData());
|
||||
if (currentLocalData &&
|
||||
currentLocalData->getAttributedString() == attributedString) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -51,7 +53,6 @@ void ParagraphShadowNode::updateLocalDataIfNeeded() {
|
||||
|
||||
Size ParagraphShadowNode::measure(LayoutConstraints layoutConstraints) const {
|
||||
return textLayoutManager_->measure(
|
||||
getTag(),
|
||||
getAttributedString(),
|
||||
getProps()->paragraphAttributes,
|
||||
layoutConstraints);
|
||||
|
@ -23,7 +23,6 @@ void *TextLayoutManager::getNativeTextLayoutManager() const {
|
||||
}
|
||||
|
||||
Size TextLayoutManager::measure(
|
||||
Tag reactTag,
|
||||
AttributedString attributedString,
|
||||
ParagraphAttributes paragraphAttributes,
|
||||
LayoutConstraints layoutConstraints) const {
|
||||
@ -34,7 +33,6 @@ Size TextLayoutManager::measure(
|
||||
auto clazz =
|
||||
jni::findClassStatic("com/facebook/fbreact/fabric/FabricUIManager");
|
||||
static auto measure = clazz->getMethod<jlong(
|
||||
jint,
|
||||
jstring,
|
||||
ReadableNativeMap::javaobject,
|
||||
ReadableNativeMap::javaobject,
|
||||
@ -52,7 +50,6 @@ Size TextLayoutManager::measure(
|
||||
local_ref<JString> componentName = make_jstring("RCTText");
|
||||
return yogaMeassureToSize(measure(
|
||||
fabricUIManager,
|
||||
reactTag,
|
||||
componentName.get(),
|
||||
ReadableNativeMap::newObjectCxxArgs(toDynamic(attributedString)).get(),
|
||||
ReadableNativeMap::newObjectCxxArgs(toDynamic(paragraphAttributes)).get(),
|
||||
|
@ -34,7 +34,6 @@ class TextLayoutManager {
|
||||
* Measures `attributedString` using native text rendering infrastructure.
|
||||
*/
|
||||
Size measure(
|
||||
Tag reactTag,
|
||||
AttributedString attributedString,
|
||||
ParagraphAttributes paragraphAttributes,
|
||||
LayoutConstraints layoutConstraints) const;
|
||||
|
@ -33,7 +33,6 @@ class TextLayoutManager {
|
||||
* Measures `attributedString` using native text rendering infrastructure.
|
||||
*/
|
||||
Size measure(
|
||||
Tag reactTag,
|
||||
AttributedString attributedString,
|
||||
ParagraphAttributes paragraphAttributes,
|
||||
LayoutConstraints layoutConstraints) const;
|
||||
|
@ -27,7 +27,6 @@ void *TextLayoutManager::getNativeTextLayoutManager() const {
|
||||
}
|
||||
|
||||
Size TextLayoutManager::measure(
|
||||
Tag reactTag,
|
||||
AttributedString attributedString,
|
||||
ParagraphAttributes paragraphAttributes,
|
||||
LayoutConstraints layoutConstraints) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user