Skip to content

Instantly share code, notes, and snippets.

@jenbennings
Last active August 29, 2015 13:57
Show Gist options
  • Save jenbennings/9656274 to your computer and use it in GitHub Desktop.
Save jenbennings/9656274 to your computer and use it in GitHub Desktop.
Isometric test for Sketch
#import 'elegantchaos.js'
if ([selection length] === 1) {
var layer = selection[0],
frame = [layer frame],
height = [frame height];
// rotate it
[layer setRotation:"45"];
// flatten it
com.elegantchaos.execute(function() {
com.elegantchaos.sendAction('flatten:');
com.elegantchaos.log(doc.selectedLayers());
});
// reduce height
[frame setHeight:(height / 2)];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment