mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user