-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclearRect.js
59 lines (59 loc) · 1.44 KB
/
clearRect.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
module.exports = {
name: "clearRect",
ns: "canvas",
async: true,
title: "Clear Rectangle",
description: "Sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black.",
phrases: {
active: "Clearing rectangle"
},
ports: {
input: {
context: {
title: "Context",
async: true,
type: "CanvasRenderingContext2D",
required: true,
fn: function __CONTEXT__(data, source, state, input, $, output) {
var r = function() {
$.context.clearRect($.x, $.y, $.width, $.height);
output({
context: $.get('context')
});
}.call(this);
return {
state: state,
return: r
};
}
},
x: {
title: "X",
type: "number",
description: "The x axis of the coordinate for the rectangle starting point."
},
y: {
title: "Y",
type: "number",
description: "The y axis of the coordinate for the rectangle starting point."
},
width: {
title: "Width",
type: "number",
description: "The rectangle's width."
},
height: {
title: "Height",
type: "number",
description: "The rectangle's height."
}
},
output: {
context: {
title: "Context",
type: "CanvasRenderingContext2D"
}
}
},
state: {}
}