From cd935e7049172a25d10b592c4e916008ab823508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20G=C3=B6the?= Date: Thu, 30 Nov 2017 16:09:16 -0800 Subject: [PATCH] Fix image rendering bug in sketch v >= 47 Images are no longer instantiated the same way in Sketch. --- src/library/data.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/library/data.js b/src/library/data.js index 3250e5e..3c44af8 100644 --- a/src/library/data.js +++ b/src/library/data.js @@ -341,7 +341,11 @@ export function getImageData(image) { if (!image) return //create image data with image - return MSImageData.alloc().initWithImage_convertColorSpace(image, false) + if (MSApplicationMetadata.metadata().appVersion < 47) { + return MSImageData.alloc().initWithImage_convertColorSpace(image, false); + } + + return MSImageData.alloc().initWithImage(image); } @@ -859,4 +863,4 @@ export function flattenTable(data) { return groups } -} \ No newline at end of file +}