summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
index b8e535b..ba425ec 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
@@ -1,208 +1,205 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29// 26//
30 //look.js 27 //look.js
31 //Look 28 //Look
32// 29//
33 //Created by Giulio Cesare Solaroli on 3/15/10 30 //Created by Giulio Cesare Solaroli on 3/15/10
34 //Copyright 2010 Clipperz 31 //Copyright 2010 Clipperz
35 //This code was generated by Opacity. You may use or modify it in any way. 32 //This code was generated by Opacity. You may use or modify it in any way.
36// 33//
37 34
38var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; 35var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0;
39var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; 36var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0;
40 37
41function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) 38function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness)
42{ 39{
43 var context = canvas.getContext("2d"); 40 var context = canvas.getContext("2d");
44 var alignStroke; 41 var alignStroke;
45 var resolution; 42 var resolution;
46 var stroke; 43 var stroke;
47 var path; 44 var path;
48 var pointX; 45 var pointX;
49 var pointY; 46 var pointY;
50 if (window.devicePixelRatio) 47 if (window.devicePixelRatio)
51 resolution = window.devicePixelRatio; 48 resolution = window.devicePixelRatio;
52 else 49 else
53 resolution = 1.0; 50 resolution = 1.0;
54 resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); 51 resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight);
55 52
56 context.save(); 53 context.save();
57 context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); 54 context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight);
58 context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight); 55 context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight);
59 56
60 // Layer 6 57 // Layer 6
61 58
62 stroke = aThickness; 59 stroke = aThickness;
63 stroke *= resolution; 60 stroke *= resolution;
64 if (stroke < 1.0) 61 if (stroke < 1.0)
65 stroke = Math.ceil(stroke); 62 stroke = Math.ceil(stroke);
66 else 63 else
67 stroke = Math.round(stroke); 64 stroke = Math.round(stroke);
68 stroke /= resolution; 65 stroke /= resolution;
69 alignStroke = (0.5 * stroke * resolution) % 1.0; 66 alignStroke = (0.5 * stroke * resolution) % 1.0;
70 context.save(); 67 context.save();
71 context.translate(17.5, 23.0); 68 context.translate(17.5, 23.0);
72 context.rotate(-0.503); 69 context.rotate(-0.503);
73 context.translate(-17.5, -23.0); 70 context.translate(-17.5, -23.0);
74 context.beginPath(); 71 context.beginPath();
75 pointX = 28.5; 72 pointX = 28.5;
76 pointY = 31.5; 73 pointY = 31.5;
77 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 74 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
78 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 75 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
79 context.moveTo(pointX, pointY); 76 context.moveTo(pointX, pointY);
80 pointX = 28.5; 77 pointX = 28.5;
81 pointY = 14.5; 78 pointY = 14.5;
82 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 79 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
83 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 80 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
84 context.lineTo(pointX, pointY); 81 context.lineTo(pointX, pointY);
85 pointX = 6.5; 82 pointX = 6.5;
86 pointY = 14.5; 83 pointY = 14.5;
87 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 84 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
88 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 85 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
89 context.lineTo(pointX, pointY); 86 context.lineTo(pointX, pointY);
90 pointX = 6.5; 87 pointX = 6.5;
91 pointY = 31.5; 88 pointY = 31.5;
92 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 89 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
93 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 90 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
94 context.lineTo(pointX, pointY); 91 context.lineTo(pointX, pointY);
95 pointX = 28.5; 92 pointX = 28.5;
96 pointY = 31.5; 93 pointY = 31.5;
97 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 94 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
98 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 95 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
99 context.lineTo(pointX, pointY); 96 context.lineTo(pointX, pointY);
100 context.closePath(); 97 context.closePath();
101 context.fillStyle = aFillColor; 98 context.fillStyle = aFillColor;
102 context.fill(); 99 context.fill();
103 context.strokeStyle = aColor; 100 context.strokeStyle = aColor;
104 context.lineWidth = stroke; 101 context.lineWidth = stroke;
105 context.lineCap = "square"; 102 context.lineCap = "square";
106 context.stroke(); 103 context.stroke();
107 context.restore(); 104 context.restore();
108 105
109 // Layer 3 106 // Layer 3
110 107
111 stroke = aThickness; 108 stroke = aThickness;
112 stroke *= resolution; 109 stroke *= resolution;
113 if (stroke < 1.0) 110 if (stroke < 1.0)
114 stroke = Math.ceil(stroke); 111 stroke = Math.ceil(stroke);
115 else 112 else
116 stroke = Math.round(stroke); 113 stroke = Math.round(stroke);
117 stroke /= resolution; 114 stroke /= resolution;
118 alignStroke = (0.5 * stroke * resolution) % 1.0; 115 alignStroke = (0.5 * stroke * resolution) % 1.0;
119 context.save(); 116 context.save();
120 context.translate(22.5, 20.0); 117 context.translate(22.5, 20.0);
121 context.rotate(-0.071); 118 context.rotate(-0.071);
122 context.translate(-22.5, -20.0); 119 context.translate(-22.5, -20.0);
123 context.beginPath(); 120 context.beginPath();
124 pointX = 33.5; 121 pointX = 33.5;
125 pointY = 28.5; 122 pointY = 28.5;
126 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 123 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
127 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 124 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
128 context.moveTo(pointX, pointY); 125 context.moveTo(pointX, pointY);
129 pointX = 33.5; 126 pointX = 33.5;
130 pointY = 11.5; 127 pointY = 11.5;
131 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 128 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
132 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 129 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
133 context.lineTo(pointX, pointY); 130 context.lineTo(pointX, pointY);
134 pointX = 11.5; 131 pointX = 11.5;
135 pointY = 11.5; 132 pointY = 11.5;
136 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 133 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
137 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 134 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
138 context.lineTo(pointX, pointY); 135 context.lineTo(pointX, pointY);
139 pointX = 11.5; 136 pointX = 11.5;
140 pointY = 28.5; 137 pointY = 28.5;
141 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 138 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
142 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 139 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
143 context.lineTo(pointX, pointY); 140 context.lineTo(pointX, pointY);
144 pointX = 33.5; 141 pointX = 33.5;
145 pointY = 28.5; 142 pointY = 28.5;
146 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 143 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
147 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 144 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
148 context.lineTo(pointX, pointY); 145 context.lineTo(pointX, pointY);
149 context.closePath(); 146 context.closePath();
150 context.fillStyle = aFillColor; 147 context.fillStyle = aFillColor;
151 context.fill(); 148 context.fill();
152 context.strokeStyle = aColor; 149 context.strokeStyle = aColor;
153 context.lineWidth = stroke; 150 context.lineWidth = stroke;
154 context.lineCap = "square"; 151 context.lineCap = "square";
155 context.stroke(); 152 context.stroke();
156 context.restore(); 153 context.restore();
157 154
158 // Layer 4 155 // Layer 4
159 156
160 stroke = aThickness; 157 stroke = aThickness;
161 stroke *= resolution; 158 stroke *= resolution;
162 if (stroke < 1.0) 159 if (stroke < 1.0)
163 stroke = Math.ceil(stroke); 160 stroke = Math.ceil(stroke);
164 else 161 else
165 stroke = Math.round(stroke); 162 stroke = Math.round(stroke);
166 stroke /= resolution; 163 stroke /= resolution;
167 alignStroke = (0.5 * stroke * resolution) % 1.0; 164 alignStroke = (0.5 * stroke * resolution) % 1.0;
168 context.save(); 165 context.save();
169 context.translate(27.5, 18.0); 166 context.translate(27.5, 18.0);
170 context.rotate(0.232); 167 context.rotate(0.232);
171 context.translate(-27.5, -18.0); 168 context.translate(-27.5, -18.0);
172 context.beginPath(); 169 context.beginPath();
173 pointX = 38.5; 170 pointX = 38.5;
174 pointY = 26.5; 171 pointY = 26.5;
175 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 172 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
176 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 173 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
177 context.moveTo(pointX, pointY); 174 context.moveTo(pointX, pointY);
178 pointX = 38.5; 175 pointX = 38.5;
179 pointY = 9.5; 176 pointY = 9.5;
180 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 177 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
181 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 178 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
182 context.lineTo(pointX, pointY); 179 context.lineTo(pointX, pointY);
183 pointX = 16.5; 180 pointX = 16.5;
184 pointY = 9.5; 181 pointY = 9.5;
185 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 182 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
186 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 183 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
187 context.lineTo(pointX, pointY); 184 context.lineTo(pointX, pointY);
188 pointX = 16.5; 185 pointX = 16.5;
189 pointY = 26.5; 186 pointY = 26.5;
190 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 187 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
191 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 188 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
192 context.lineTo(pointX, pointY); 189 context.lineTo(pointX, pointY);
193 pointX = 38.5; 190 pointX = 38.5;
194 pointY = 26.5; 191 pointY = 26.5;
195 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 192 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
196 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 193 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
197 context.lineTo(pointX, pointY); 194 context.lineTo(pointX, pointY);
198 context.closePath(); 195 context.closePath();
199 context.fillStyle = aFillColor; 196 context.fillStyle = aFillColor;
200 context.fill(); 197 context.fill();
201 context.strokeStyle = aColor; 198 context.strokeStyle = aColor;
202 context.lineWidth = stroke; 199 context.lineWidth = stroke;
203 context.lineCap = "square"; 200 context.lineCap = "square";
204 context.stroke(); 201 context.stroke();
205 context.restore(); 202 context.restore();
206 203
207 context.restore(); 204 context.restore();
208} 205}