fix: don't set zero dimensions on RNSVGGroup (#2612)

# Summary

Fixes #2610

It's more of a hack than the best fix for that; however, it's a
regression that we should address.

## Test Plan
Test case provided in #2610
This commit is contained in:
Jakub Grzywacz
2025-01-20 12:01:47 +01:00
committed by GitHub
parent 476df53618
commit f2ce29dabe

View File

@@ -8,15 +8,19 @@ RNSVGLayoutableShadowNode::RNSVGLayoutableShadowNode(
const ShadowNodeFamily::Shared &family, const ShadowNodeFamily::Shared &family,
ShadowNodeTraits traits) ShadowNodeTraits traits)
: YogaLayoutableShadowNode(fragment, family, traits) { : YogaLayoutableShadowNode(fragment, family, traits) {
if (std::strcmp(this->getComponentName(), "RNSVGGroup") != 0) {
setZeroDimensions(); setZeroDimensions();
} }
}
RNSVGLayoutableShadowNode::RNSVGLayoutableShadowNode( RNSVGLayoutableShadowNode::RNSVGLayoutableShadowNode(
const ShadowNode &sourceShadowNode, const ShadowNode &sourceShadowNode,
const ShadowNodeFragment &fragment) const ShadowNodeFragment &fragment)
: YogaLayoutableShadowNode(sourceShadowNode, fragment) { : YogaLayoutableShadowNode(sourceShadowNode, fragment) {
if (std::strcmp(this->getComponentName(), "RNSVGGroup") != 0) {
setZeroDimensions(); setZeroDimensions();
} }
}
void RNSVGLayoutableShadowNode::setZeroDimensions() { void RNSVGLayoutableShadowNode::setZeroDimensions() {
// SVG handles its layout manually on the native side and does not depend on // SVG handles its layout manually on the native side and does not depend on