Skip to content

Commit

Permalink
Fix for Version 97
Browse files Browse the repository at this point in the history
  • Loading branch information
inderjits1 committed Jun 6, 2023
1 parent 92a7754 commit 91dd6d6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Miro.sketchplugin/Contents/Sketch/core/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 91dd6d6

Please sign in to comment.