Skip to content

Commit

Permalink
Merge pull request #32 from miroapp/fix-sync-2
Browse files Browse the repository at this point in the history
Fix issue with Sketch 96
  • Loading branch information
inderjits1 authored Jun 5, 2023
2 parents 56fd0ad + 38cd96f commit c8d4509
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions RealtimeBoard.sketchplugin/Contents/Sketch/core/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,19 @@ function Api() {
var resourceId = context.command.valueForKey_onLayer_forPluginIdentifier(boardId, artboard, "rtb_sync");
var originalId = context.command.valueForKey_onLayer_forPluginIdentifier("originalId", artboard, "rtb_sync");
var objectId = [artboard objectID];


const document = [artboard documentData];
const immutable = [artboard immutableModelObject];
const relativeInfluenceRect = immutable.influenceRectForBoundsInDocument(document);
var xPos = relativeInfluenceRect.origin.x;
var yPos = relativeInfluenceRect.origin.y;
var width = relativeInfluenceRect.size.width;
var height = relativeInfluenceRect.size.height;

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;
var height = layer.size.height;


var centralXPos = width / 2 + xPos;
var centralYPos = height / 2 + yPos;
var transformationData = '\\"positionData\\":{\\"x\\": ' + centralXPos + ', \\"y\\":' + centralYPos + ' }';
Expand Down Expand Up @@ -359,6 +364,7 @@ function Api() {


var classNameOfOuput = NSStringFromClass([outputData class]);


if (classNameOfOuput != "_NSZeroData") {
var res = [NSJSONSerialization JSONObjectWithData:outputData options:NSJSONReadingMutableLeaves error:nil]
Expand Down
2 changes: 1 addition & 1 deletion RealtimeBoard.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Miro",
"identifier" : "com.realtimeboard.sketch.plugin",
"version" : "1.6.6",
"version" : "1.6.7",
"description" : "Export and sync your artboards with Miro",
"authorEmail" : "[email protected]",
"author" : "Miro",
Expand Down

0 comments on commit c8d4509

Please sign in to comment.