From 91dd6d6c1a9fe0646769fef126137aaa45fed9ac Mon Sep 17 00:00:00 2001 From: Inderjit Singh Date: Tue, 6 Jun 2023 15:23:50 +0200 Subject: [PATCH] Fix for Version 97 --- Miro.sketchplugin/Contents/Sketch/core/api.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Miro.sketchplugin/Contents/Sketch/core/api.js b/Miro.sketchplugin/Contents/Sketch/core/api.js index 0ae344e..b942490 100644 --- a/Miro.sketchplugin/Contents/Sketch/core/api.js +++ b/Miro.sketchplugin/Contents/Sketch/core/api.js @@ -285,12 +285,14 @@ function Api() { var originalId = context.command.valueForKey_onLayer_forPluginIdentifier("originalId", artboard, "rtb_sync"); var objectId = [artboard objectID]; + var layer + if (artboard.respondsToSelector_(NSSelectorFromString("absoluteInfluenceRect"))) { + // Sketch < 96 + layer = artboard.absoluteInfluenceRect(); + } else { + layer = artboard.rect() + } - const document = [artboard documentData]; - const immutable = [artboard immutableModelObject]; - - var relativeInfluenceRect = immutable.influenceRectForBoundsInDocument(document); - const layer = artboard.convertRect_toLayer_(relativeInfluenceRect, /* to absolute/page coordinates */null) var xPos = layer.origin.x; var yPos = layer.origin.y; var width = layer.size.width;