mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 15:14:18 +00:00
fix fillOpacity with gradients
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
CGContextAddPath(context, self.d);
|
||||
CGContextClip(context);
|
||||
RNSVGBrushConverter *brushConverter = [[self getSvgView] getDefinedBrushConverter:[self.fill brushRef]];
|
||||
[self.fill paint:context opacity:self.strokeOpacity brushConverter:brushConverter];
|
||||
[self.fill paint:context opacity:self.fillOpacity brushConverter:brushConverter];
|
||||
CGContextRestoreGState(context);
|
||||
if (!self.stroke) {
|
||||
return;
|
||||
|
||||
+2
-11
@@ -23,21 +23,12 @@
|
||||
{
|
||||
RNSVGNode* template = [[self getSvgView] getDefinedTemplate:self.href];
|
||||
if (template) {
|
||||
CGFloat opacity = self.opacity;
|
||||
BOOL transparent = opacity < 1;
|
||||
|
||||
if (transparent) {
|
||||
CGContextBeginTransparencyLayer(context, NULL);
|
||||
}
|
||||
|
||||
[self beginTransparencyLayer:context];
|
||||
[self clip:context];
|
||||
[template mergeProperties:self mergeList:self.mergeList];
|
||||
[template renderTo:context];
|
||||
[template resetProperties];
|
||||
|
||||
if (transparent) {
|
||||
CGContextEndTransparencyLayer(context);
|
||||
}
|
||||
[self endTransparencyLayer:context];
|
||||
} else if (self.href) {
|
||||
// TODO: calling yellow box here
|
||||
RCTLogWarn(@"`Use` element expected a pre-defined svg template as `href` prop, template named: %@ is not defined.", self.href);
|
||||
|
||||
Reference in New Issue
Block a user