Fix the detection of SVGImageRep on macOS AppKit
This commit is contained in:
parent
a936e64ab1
commit
095fc63f8a
|
@ -143,6 +143,7 @@
|
|||
|
||||
- (BOOL)sd_isVector {
|
||||
NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
|
||||
// This may returns a NSProxy, so don't use `class` to check
|
||||
NSImageRep *imageRep = [self bestRepresentationForRect:imageRect context:nil hints:nil];
|
||||
if ([imageRep isKindOfClass:[NSPDFImageRep class]]) {
|
||||
return YES;
|
||||
|
@ -150,7 +151,8 @@
|
|||
if ([imageRep isKindOfClass:[NSEPSImageRep class]]) {
|
||||
return YES;
|
||||
}
|
||||
if ([NSStringFromClass(imageRep.class) hasSuffix:@"NSSVGImageRep"]) {
|
||||
Class NSSVGImageRepClass = NSClassFromString([NSString stringWithFormat:@"_%@", SD_NSSTRING(NSSVGImageRep)]);
|
||||
if ([imageRep isKindOfClass:NSSVGImageRepClass]) {
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
|
Loading…
Reference in New Issue