-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderer.js
106 lines (83 loc) · 2.47 KB
/
Renderer.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* Copyright (c) 1996-2012 Clickteam
*
* This source code is part of the HTML5 exporter for Clickteam Multimedia Fusion 2.
*
* Permission is hereby granted to any person obtaining a legal copy
* of Clickteam Multimedia Fusion 2 to use or modify this source code for
* debugging, optimizing, or customizing applications created with
* Clickteam Multimedia Fusion 2.
* Any other use of this source code is prohibited.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
function Renderer()
{
this.clips = [];
};
Renderer.prototype =
{
renderSolidColor: function (x, y, w, h, color, inkEffect, inkEffectParam)
{
},
renderSolidColorEllipse: function (x, y, w, h, color, inkEffect, inkEffectParam)
{
},
renderGradient: function (x, y, w, h, color1, color2, vertical, inkEffect, inkEffectParam)
{
},
renderGradientEllipse: function (x, y, w, h, color1, color2, vertical, inkEffect, inkEffectParam)
{
},
renderImage: function (image, x, y, angle, scaleX, scaleY, inkEffect, inkEffectParam)
{
},
renderSimpleImage: function (image, x, y, w, h, inkEffect, inkEffectParam)
{
},
renderPattern: function (image, x, y, w, h, inkEffect, inkEffectParam)
{
},
renderPatternEllipse: function (image, x, y, w, h, inkEffect, inkEffectParam)
{
},
renderLine: function (xA, yA, xB, yB, color, thickness, inkEffect, inkEffectParam)
{
},
renderRect: function (x, y, w, h, color, thickness, inkEffect, inkEffectParam)
{
},
renderEllipse: function (x, y, w, h, color, inkEffect, inkEffectParam)
{
},
renderTriangle: function (x, y, b, h, color, orientation)
{
},
pushClip: function (x, y, w, h)
{
var curClip = this.clips[this.clips.length - 1];
if (curClip)
{
if (x < curClip.x)
x = curClip.x;
if (y < curClip.y)
y = curClip.y;
if ((x + w) > (curClip.x + curClip.w))
w = (curClip.x + curClip.w) - x;
if ((y + h) > (curClip.y + curClip.h))
h = (curClip.y + curClip.h) - y;
}
var clip = { x: x, y: y, w: w, h: h };
this.clips.push(clip);
return clip;
},
popClip: function ()
{
this.clips.pop();
}
};