react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

SVG component become pixelated when applying rotation

Open paul-leymet opened this issue 3 years ago • 6 comments

Question

Environnement

  • Google Pixel 3a (real device)
  • reproduced on Google Pixel 4 (emulator)

Packages versions

    "react": "17.0.2",
    "react-native": "0.67.2",
    "react-native-svg": "12.4.4"

Issue

When applying rotation to the following SVG, the component become pixelated (see following images).

const HeartSvg = (props: SvgProps) => (
<Svg data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.32 15.01" {...props}>
  <Path
    d="M7.66 15.01c15.5-10.36 3.24-19.65 0-12.48-3.26-7.19-15.48 2.14 0 12.48"
    style={{
      fill: '#fff',
    }}
  />
  <Path
    d="M7.64 13.94c13.83-8.86 2.79-17.54 0-10.36-2.8-7.19-13.81 1.52 0 10.36"
    style={{
      fill: '#d51f39',
    }}
  />
</Svg>
)

export default HeartSvg
Without rotation With rotation
Capture d’écran 2022-09-28 à 16 28 45 Capture d’écran 2022-09-28 à 16 29 03
Capture d’écran 2022-09-28 à 16 31 10 Capture d’écran 2022-09-28 à 16 31 47

Notice the jagged edges on the right images.

→ Do you guys know how to avoid this kind of effect ?

paul-leymet avatar Sep 28 '22 14:09 paul-leymet

Same issue here

pietroanello avatar Feb 09 '23 14:02 pietroanello

Same here with scale

tonyjaimep avatar Mar 21 '23 20:03 tonyjaimep

In my case iOS works very well, but Android pixelated It's just SVG with applied transform-scale property

    "react-native-svg": "13.9.0",
    "react-native": "0.71.6",

https://user-images.githubusercontent.com/9128731/233033868-2f6dd500-a566-465d-bdf9-d6a17cfc3ae3.mov

whalemare avatar Apr 19 '23 09:04 whalemare

Same here with scale

samandarkuchkarov avatar Sep 07 '23 06:09 samandarkuchkarov

Seeing the same issue as well - any updates here?

techgerm avatar Nov 18 '23 02:11 techgerm

same, on a real device too

welschmoor avatar Jan 12 '24 14:01 welschmoor