You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Source/AppKit additions/SVGKImageRep.m
-21Lines changed: 0 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,6 @@
16
16
#import"SVGKImage+CGContext.h"
17
17
#include<tgmath.h>
18
18
19
-
#defineTEMPORARY_WARNING_FOR_APPLES_BROKEN_RENDERINCONTEXT_METHOD1// ONLY needed as temporary workaround for Apple's renderInContext bug breaking various bits of rendering: Gradients, Scaling, etc
Copy file name to clipboardExpand all lines: Source/DOM classes/SVG-DOM/SVGHelperUtilities.h
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
#defineFORCE_RASTERIZE_LAYERS0// If True, all CALayers will be told to rasterize themselves. This MIGHT increase performance (or might not), but leads to blurriness whenever a layer is scaled / zoomed in
17
17
#defineIMPROVE_PERFORMANCE_BY_WORKING_AROUND_APPLE_FRAME_ALIGNMENT_BUG1// NB: Apple's code for rendering ANY CALayer is extremely slow if the layer has non-integer co-ordinates for its "frame" or "bounds" property. This flag technically makes your SVG's render incorrect at sub-pixel level, but often increases performance of Apple's rendering by a factor of 2 or more!
18
-
18
+
@class SVGGradientLayer;
19
19
@interfaceSVGHelperUtilities : NSObject
20
20
21
21
/**
@@ -49,9 +49,13 @@ This method ONLY looks at current node to establish the above two things, to do
SVGColor strokeColorAsSVGColor = SVGColorFromString([actualStroke UTF8String]); // have to use the intermediate of an SVGColor so that we can over-ride the ALPHA component in next line
// SVG spec: Vertical and horizontal lines don't have a boundingbox, since they are one-dimensional, even though the stroke-width makes it look like they should have a boundingbox with non-zero width and height.
NSAssert( svgElement.rootOfCurrentDocumentFragment != nil, @"This SVG shape has a URL fill type; it needs to search for that URL (%@) inside its nearest-ancestor <SVG> node, but the rootOfCurrentDocumentFragment reference was nil (suggests the parser failed, or the SVG file is corrupt)", gradId );
NSAssert( svgGradient != nil, @"This SVG shape has a URL fill (%@), but could not find an XML Node with that ID inside the DOM tree (suggests the parser failed, or the SVG file is corrupt)", gradId );
557
+
if (svgGradient == nil) {
558
+
// SVG spec allows referenced gradient not exist and will use fallback color
559
+
SVGKitLogWarn(@"This SVG shape has a URL fill (%@), but could not find an XML Node with that ID inside the DOM tree (suggests the parser failed, or the SVG file is corrupt)", gradId );
if (![actualPaintColor isEqualToString:@"none"]) {
624
+
paintColorSVGColor = SVGColorFromString([actualPaintColor UTF8String]); // have to use the intermediate of an SVGColor so that we can over-ride the ALPHA component in next line
// This is a tempory workaround. Apple's `CAGradientLayer` does not support focal point for radial gradient. We have to use the low-level API `CGContextDrawRadialGradient` and using custom software-render for focal point. So it does not works for `SVGLayredView` which is hardware-render by CA render server.
SVGKitLogVerbose(@"The radialGradient element #%@ contains focal value: (fx:%@, fy: %@, fr:%@). The focul value is only supported on `SVGFastimageView` and it will be ignored when rendering in SVGLayredView.", [selfgetAttribute:@"id"], fxAttr, fyAttr, frAttr);
60
+
SVGKitLogWarn(@"The radialGradient element #%@ contains focal value: (fx:%@, fy: %@, fr:%@). The focul value is only supported on `SVGFastimageView` and it will be ignored when rendering in SVGLayredView.", [selfgetAttribute:@"id"], fxAttr, fyAttr, frAttr);
0 commit comments