Low quality of mask, iOS
See original GitHub issueHello. I just tryed to apply circle stroke mask.
Android 8 draws it perfectly like something vector. But iOS draws it low quality:
(Screenshot from iOS)
import { Svg, Defs, Rect, Circle, LinearGradient, Stop, G, Mask, Use } from 'react-native-svg';
const STOP_COLOR = 'red';
class Keck extends PureComponent {
render() {
const { rotation } = this.props;
const innerDefs = [
// bottom left rectangle
{ x: 0, y: 60, start: 0.9, end: 1 },
// top left rectangle
{ x: 0, y: 0, start: 0.9, end: 0.75 },
// top right rectangle
{ x: 60, y: 0, start: 0.75, end: 0.3 },
// bottom right rectangle
{ x: 60, y: 60, start: 0, end: 0.5 },
];
return (
<Svg height="120" width="120" fill="transparent">
<Defs>
<Mask id="mask"
x="0"
y="0"
width={120}
height={120}
maskUnits="userSpaceOnUse"
>
<Circle
r={42}
cx={60}
cy={60}
stroke="white"
strokeWidth={6}
strokeDasharray="1 4.5"
/>
</Mask>
</Defs>
<G mask="url(#mask)">
<G rotation={rotation} origin="60, 60">
<OpticalGradient definitions={innerDefs} />
</G>
</G>
</Svg>
);
}
}
Why does it happens? Looks like something about 1x, 2x, 3x dpi… but I don’t get it where props about resolution…
PS: I don’t show you <OpticalGradient ... />
because it’s simple gradients rectangles which works fine. But mask of dotted circle is very ugly on iOS. If I use <Circle … /> without mask – it renders well, but I need to rotate gradient only inside Circle strokes.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12
Top Results From Across the Web
Low quality of mask, iOS · Issue #1098 - GitHub
Hello. I just tryed to apply circle stroke mask. Android 8 draws it perfectly like something vector. But iOS draws it low quality:...
Read more >Low quality of capture view context on iPad - Stack Overflow
I need capture specific UIView , but the result is in low quality how can fix this and increase the quality ? UIGraphicsBeginImageContext( ......
Read more >Face ID With a Mask: How It Works and What You Need to Know
Face ID when wearing a mask works just like Face ID without a mask. You swipe up on the iPhone's display and it...
Read more >VisionKit | Apple Developer Forums
Hey guys, facing the issue that scanned documents on my iPhone 12 Pro Max with Files app are pretty bad quality. Guess it...
Read more >Apple Is Working On Face ID With Masks Feature; Bad News ...
In the newest developer beta of its iOS 15.4 patch, Apple is testing the "Face ID with mask" functionality. By Mashable News Staff...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can’t use
style={{transform: [{scale: TRANSFORM_RESOLUTION}]}}
because it will drop fps with animation.Still facing the issue even with the svg
width="100%"
suggestion