sketch-hq / SketchAPI

The JavaScript plugin library embedded in Sketch
https://developer.sketch.com/reference/api
MIT License
843 stars 126 forks source link

CocoaScript API for querying and changing the starting point of a vector line #329

Closed justin-calleja closed 5 years ago

justin-calleja commented 5 years ago

I tried looking into implementing a plugin for the issue brought up in the video in this blog post: https://medium.com/sketch-app/what-s-up-with-sketch-s-scissors-tool-ebdf4d57276f

(video: https://player.vimeo.com/video/127117419)

Basically: a plugin to change the starting point of a vector line.

I'm new to Sketch plugin development. I could not find a way to query for the currently selected point of a vector here: https://developer.sketchapp.com/reference/api/

Can API calls be added for this? (Also, the plugin would require other calls to set the starting point).

Thanks

mathieudutour commented 5 years ago

That will be fixed by https://github.com/BohemianCoding/SketchAPI/pull/304. You will be able to get the starting point and modify it like this:

line.points[0]