Draw layer shape as dashed outline with handles when acting as mask

This commit is contained in:
Frederic Kettelhoit 2020-03-19 12:14:10 +01:00 committed by Atlas Cove
parent 7a93075312
commit dd71a820a3
1 changed files with 21 additions and 0 deletions

View File

@ -37,6 +37,7 @@ function Renderer (client) {
this.drawRulers()
this.drawRender(render) //
this.drawVertices()
this.drawMaskPaths()
this.drawHandles()
this.drawTranslation()
this.drawCursor()
@ -102,6 +103,26 @@ function Renderer (client) {
}
}
this.drawMaskPaths = function () {
if (client.tool.style().mask) {
for (const part of client.tool.layer()) {
for (const vertex of part['vertices']) {
this.drawVertex(vertex)
this.drawCursor(vertex, client.tool.style().thickness)
}
}
const path = new Generator(client.tool.layer(), client.tool.style()).toString({ x: 0, y: 0 }, 2)
const style = {
color: client.theme.active.f_med,
thickness: 2,
strokeLinecap: 'round',
strokeLinejoin: 'round',
strokeLineDash: [5, 15]
}
this.drawPath(path, style)
}
}
this.drawGrid = function () {
if (!this.showExtras) { return }