-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
executable file
·45 lines (34 loc) · 896 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Plugin to add Hamburger icon.
*/
var {Line, Rectangle, Color} = require("scenegraph");
const commands = require("commands");
function drawHamburger(selection) {
let lines = [];
const lineData = [
{ startX: 5, startY: 10, endX: 35, endY: 10 },
{ startX: 5, startY: 20, endX: 35, endY: 20 },
{ startX: 5, startY: 30, endX: 35, endY: 30 }
]
lineData.forEach(data => {
const line = new Line();
line.setStartEnd(
data.startX,
data.startY,
data.endX,
data.endY
);
line.strokeEnabled = true;
line.stroke = new Color("#000000");
line.strokeWidth = 5;
lines.push(line);
selection.editContext.addChild(line)
});
selection.items = lines;
commands.group();
}
module.exports = {
commands: {
drawHamburger: drawHamburger
}
};