In my app I have this code:
<Svg width={W} height={H} viewBox={viewBox} style={style} preserveAspectRatio="none">
<Defs>
<Mask id="mask" x={0} y={0} width={W} height={H} maskUnits="userSpaceOnUse" maskContentUnits='userSpaceOnUse'>
<Nested name="Path" animated d={path} stroke="white" strokeLinejoin="round" strokeWidth={10} strokeDasharray="5 60" strokeDashoffset={pathOffset}/>
</Mask>
</Defs>
<G mask="url(#mask)">
<Nested name="Path" d={path} stroke="orange" strokeLinejoin="round"/>
{fields.map( f => <Nested key={f.id} {...f}/>)}
</G>
</Svg>
where Nested
is a delegation to Path
, Circle
and other RN-SVG elements.
Now, if the G@mask
is removed, the element in Android Emulator or on real device it looks like so:
With G@mask
it is displayed with reduced precision / pixelated / blurred:
I prepared a snack -> https://snack.expo.dev/@injecteer/react-native-svg-mask and in web-mode the mask with the animation looks just fine (the bottom line):
How to display the masked elements in full precision? What am I missing?