Skip to content

Commit

Permalink
fixed lock icon, closes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikFontanel committed Jun 12, 2018
1 parent 7eb8e1a commit 1c9bca1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/toggleconstrainproportions.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
const sketch = require('sketch/dom');
const settings = require('sketch/settings');

export default function(context) {
const document = sketch.fromNative(context.document);
const selectedLayers = document.selectedLayers;
const doc = sketch.fromNative(context.document);
const selectedLayers = doc.selectedLayers;

if (selectedLayers.length > 0) {
// Toggles the currently selected item(s) 'Constrain Proportions' setting
selectedLayers.forEach(layer => {
let obj = layer.sketchObject;
obj.frame().setConstrainProportions(!obj.constrainProportions());
});

}
// Refresh UI
context.document.reloadInspector();
}

0 comments on commit 1c9bca1

Please sign in to comment.