Last active
August 29, 2015 13:57
-
-
Save jenbennings/9656274 to your computer and use it in GitHub Desktop.
Isometric test for Sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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