Skip to content

Commit

Permalink
fix: dont pass transform prop to G child in SvgView
Browse files Browse the repository at this point in the history
  • Loading branch information
WoLewicki committed Oct 28, 2022
1 parent 19bcb24 commit 5394bbb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/elements/Svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export default class Svg extends Shape<SvgProps> {

// Inherited G properties
font,
transform,
fill,
fillOpacity,
fillRule,
Expand Down Expand Up @@ -183,6 +182,11 @@ export default class Svg extends Shape<SvgProps> {
props.onLayout = onLayout;
}

// transform should not be passed down since it is already used in svgView
// and would be doubled in G causing double transformations
const gStyle = Object.assign({}, style) as ViewStyle;
gStyle.transform = undefined;

const RNSVGSvg = Platform.OS === 'android' ? RNSVGSvgAndroid : RNSVGSvgIOS;

return (
Expand All @@ -194,9 +198,8 @@ export default class Svg extends Shape<SvgProps> {
<G
{...{
children,
style,
style: gStyle,
font,
transform,
fill,
fillOpacity,
fillRule,
Expand Down

0 comments on commit 5394bbb

Please sign in to comment.