question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`patternTransform` does not render properly on iOS

See original GitHub issue

Bug

<Pattern> with patternTransform property does not render properly on iOS.

Repro

https://snack.expo.io/YEddb4zti

Running it on Android and iOS produce different results.

Workaround

I didn’t read the code thoroughly, maybe we can pre-combine viewBox transform with patternTransform at the time we create the pattern object?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:10
  • Comments:6

github_iconTop GitHub Comments

2reactions
v4dkoucommented, May 3, 2022

react-native-svg 12.3.0, issue persists on iOS with a bare React Native project (without Expo)

1reaction
outaTiMEcommented, Jun 2, 2021

I am experiencing the same problem using Expo SDK41 with react-native-svg 12.1.0 on iOS. On Android and on the Web it works as expected, did anyone find a workaround?

Code:

<Svg
  style={StyleSheet.absoluteFillObject}
  width="100%"
  height="100%"
>
  <Defs>
    <Pattern
      id="textstripe"
      patternUnits="userSpaceOnUse"
      width="225"
      height="100"
      patternTransform="rotate(-45)"
    >
      <SvgText
        y="30"
        // https://github.com/expo/expo/issues/1959#issuecomment-780198250
        fontFamily={processFontFamily(
          Settings.getFontObject().fontFamily
        )}
        // same as fonts.title
        fontSize="20"
        opacity="0.1"
        fill={Settings.getGrayColor(theme)}
      >
        {Settings.APP_COPYRIGHT}
      </SvgText>
    </Pattern>
  </Defs>
  <Rect width="100%" height="100%" fill="url(#textstripe)" />
</Svg>

Android:

2021-06-01 21 01 26

Web:

Cierre de jornada  OFICIAL: $94,23 - $10

iOS (cut and misplaced pattern):

B2E46FA3-FA92-48A1-AEBB-7029B049675A

Read more comments on GitHub >

github_iconTop Results From Across the Web

patternTransform does not render properly on iOS #1386
Running it on Android and iOS produce different results. Workaround. I didn't read the code thoroughly, maybe we can pre-combine viewBox ...
Read more >
Developers - `patternTransform` does not render properly on iOS -
<Pattern> with patternTransform property does not render properly on iOS. ... Are you a developer who can solve this issue? Get Started. IN...
Read more >
'patternTransform' : 'rotate(140)' not working in safari
patternTransform 'rotate()' is not working as expected in safari browser as it is working in chrome (color is getting changed) .
Read more >
patternTransform - SVG: Scalable Vector Graphics | MDN
The patternTransform attribute defines a list of transform definitions that are applied to a pattern tile.
Read more >
Installer crashes each time I try
Fixed an issue that video capture and render images are not saved as html files - Fixed an issue where bindings were not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found