Skip to content

Commit dfc8f42

Browse files
committed
Draw layer shape as dashed outline with handles when acting as mask
1 parent 3624689 commit dfc8f42

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

desktop/sources/scripts/renderer.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function Renderer (client) {
3737
this.drawRulers()
3838
this.drawRender(render) //
3939
this.drawVertices()
40+
this.drawMaskPaths()
4041
this.drawHandles()
4142
this.drawTranslation()
4243
this.drawCursor()
@@ -102,6 +103,26 @@ function Renderer (client) {
102103
}
103104
}
104105

106+
this.drawMaskPaths = function () {
107+
if (client.tool.style().mask) {
108+
for (const part of client.tool.layer()) {
109+
for (const vertex of part['vertices']) {
110+
this.drawVertex(vertex)
111+
this.drawCursor(vertex, client.tool.style().thickness)
112+
}
113+
}
114+
const path = new Generator(client.tool.layer(), client.tool.style()).toString({ x: 0, y: 0 }, 2)
115+
const style = {
116+
color: client.theme.active.f_med,
117+
thickness: 2,
118+
strokeLinecap: 'round',
119+
strokeLinejoin: 'round',
120+
strokeLineDash: [5, 15]
121+
}
122+
this.drawPath(path, style)
123+
}
124+
}
125+
105126
this.drawGrid = function () {
106127
if (!this.showExtras) { return }
107128

0 commit comments

Comments
 (0)