Hi,
I have a simple vector line going from point A to point B. I want to add Triangle arrow to the vertex at point B. This is how I am doing it but it is not getting applied. What am I doing wrong here?
var vector = figma.createVector()
vector.vectorNetwork.vertices[0].strokeCap = "NONE"vector.vectorNetwork.vertices[1].strokeCap = "ARROW_EQUILATERAL"
/* This plugin adds arrowheads to vectors *//* Created by Duncan Geere, Jan 2020 */for (const selection of figma.currentPage.selection) {
const node = selection as VectorNode
/* make a copy of the original node */let copy = JSON.parse(JSON.stringify(node.vectorNetwork))
/* if it has a strokeCap property, change */if ("strokeCap"in copy.vertices[copy.vertices.length-1]) {
copy.vertices[copy.vertices.length-1].strokeCap = "ARROW_EQUILATERAL"
copy.vertices[0].strokeCap = "NONE"
}
/* assign the copy back to the original */
node.vectorNetwork = copy
}
/* This plugin adds arrowheads to vectors *//* Created by Duncan Geere, Jan 2020 */for (const selection of figma.currentPage.selection) {
const node = selection as VectorNode
/* make a copy of the original node */let copy = JSON.parse(JSON.stringify(node.vectorNetwork))
/* if it has a strokeCap property, change */if ("strokeCap"in copy.vertices[copy.vertices.length-1]) {
copy.vertices[copy.vertices.length-1].strokeCap = "ARROW_EQUILATERAL"
copy.vertices[0].strokeCap = "NONE"
}
/* assign the copy back to the original */
node.vectorNetwork = copy
}
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.