Skip to content

Instantly share code, notes, and snippets.

@felideon
Last active June 13, 2017 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felideon/23eec5d0cb320736f1a6e73e4e698423 to your computer and use it in GitHub Desktop.
Save felideon/23eec5d0cb320736f1a6e73e4e698423 to your computer and use it in GitHub Desktop.
Add arrow head to end of line or vector.
/* Thanks to sample code here:
https://github.com/wodory/flowmate
https://github.com/turbobabr/Sketch-Plugins-Cookbook
*/
var selection = context.selection;
var layer = selection.firstObject();
if(layer && layer.isKindOfClass(MSShapeGroup)) {
var path = layer.layers().firstObject();
if(path && path.isKindOfClass(MSShapePathLayer)) {
path.setEndDecorationType(2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment