-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscale.js
55 lines (55 loc) · 1.08 KB
/
scale.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
module.exports = {
name: "scale",
ns: "canvas",
async: true,
title: "Scale",
description: "Scale",
phrases: {
active: "Scaling"
},
ports: {
input: {
context: {
title: "Context",
type: "CanvasRenderingContext2D",
required: true
},
"in": {
title: "Scaling factor x/y",
async: true,
type: "array",
required: true,
items: [{
type: "number",
title: "X"
},
{
type: "number",
title: "Y"
}
],
minItems: 2,
maxItems: 2,
fn: function __IN__(data, source, state, input, $, output) {
var r = function() {
$.context.scale($.in[0], $.in[1]);
output({
context: $.get('context')
});
}.call(this);
return {
state: state,
return: r
};
}
}
},
output: {
context: {
title: "Context",
type: "CanvasRenderingContext2D"
}
}
},
state: {}
}