-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlineTo.js
61 lines (61 loc) · 1.38 KB
/
lineTo.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
module.exports = {
name: "lineTo",
ns: "canvas",
async: true,
title: "Line To",
description: "Connects the last point in the subpath to the x, y coordinates with a straight line",
phrases: {
active: "Moving"
},
ports: {
input: {
context: {
title: "Context",
type: "CanvasRenderingContext2D",
required: true
},
"in": {
title: "Point",
async: true,
type: "object",
required: true,
properties: {
x: {
type: "number",
title: "X",
description: "The x axis of the coordinate for the end of the line"
},
y: {
type: "number",
title: "Y",
description: "The y axis of the coordinate for the end of the line"
}
},
fn: function __IN__(data, source, state, input, $, output) {
var r = function() {
$.context.lineTo($.in.x, $.in.y);
output({
context: $.get('context'),
out: $.get('in')
});
}.call(this);
return {
state: state,
return: r
};
}
}
},
output: {
context: {
title: "Context",
type: "CanvasRenderingContext2D"
},
out: {
title: "Point",
type: "array"
}
}
},
state: {}
}