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) (show whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js22
1 files changed, 10 insertions, 12 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 ba425ec..dae5a2d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
@@ -1,118 +1,116 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //look.js 25 //look.js
28 //Look 26 //Look
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/15/10 28 //Created by Giulio Cesare Solaroli on 3/15/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; 33var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0;
36var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; 34var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0;
37 35
38function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) 36function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var stroke; 41 var stroke;
44 var path; 42 var path;
45 var pointX; 43 var pointX;
46 var pointY; 44 var pointY;
47 if (window.devicePixelRatio) 45 if (window.devicePixelRatio)
48 resolution = window.devicePixelRatio; 46 resolution = window.devicePixelRatio;
49 else 47 else
50 resolution = 1.0; 48 resolution = 1.0;
51 resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); 49 resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight);
52 50
53 context.save(); 51 context.save();
54 context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); 52 context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / 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); 53 context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight);
56 54
57 // Layer 6 55 // Layer 6
58 56
59 stroke = aThickness; 57 stroke = aThickness;
60 stroke *= resolution; 58 stroke *= resolution;
61 if (stroke < 1.0) 59 if (stroke < 1.0)
62 stroke = Math.ceil(stroke); 60 stroke = Math.ceil(stroke);
63 else 61 else
64 stroke = Math.round(stroke); 62 stroke = Math.round(stroke);
65 stroke /= resolution; 63 stroke /= resolution;
66 alignStroke = (0.5 * stroke * resolution) % 1.0; 64 alignStroke = (0.5 * stroke * resolution) % 1.0;
67 context.save(); 65 context.save();
68 context.translate(17.5, 23.0); 66 context.translate(17.5, 23.0);
69 context.rotate(-0.503); 67 context.rotate(-0.503);
70 context.translate(-17.5, -23.0); 68 context.translate(-17.5, -23.0);
71 context.beginPath(); 69 context.beginPath();
72 pointX = 28.5; 70 pointX = 28.5;
73 pointY = 31.5; 71 pointY = 31.5;
74 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 72 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
75 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 73 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
76 context.moveTo(pointX, pointY); 74 context.moveTo(pointX, pointY);
77 pointX = 28.5; 75 pointX = 28.5;
78 pointY = 14.5; 76 pointY = 14.5;
79 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 77 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
80 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 78 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
81 context.lineTo(pointX, pointY); 79 context.lineTo(pointX, pointY);
82 pointX = 6.5; 80 pointX = 6.5;
83 pointY = 14.5; 81 pointY = 14.5;
84 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 82 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
85 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 83 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
86 context.lineTo(pointX, pointY); 84 context.lineTo(pointX, pointY);
87 pointX = 6.5; 85 pointX = 6.5;
88 pointY = 31.5; 86 pointY = 31.5;
89 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 87 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
90 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 88 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
91 context.lineTo(pointX, pointY); 89 context.lineTo(pointX, pointY);
92 pointX = 28.5; 90 pointX = 28.5;
93 pointY = 31.5; 91 pointY = 31.5;
94 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; 92 pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution;
95 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; 93 pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution;
96 context.lineTo(pointX, pointY); 94 context.lineTo(pointX, pointY);
97 context.closePath(); 95 context.closePath();
98 context.fillStyle = aFillColor; 96 context.fillStyle = aFillColor;
99 context.fill(); 97 context.fill();
100 context.strokeStyle = aColor; 98 context.strokeStyle = aColor;
101 context.lineWidth = stroke; 99 context.lineWidth = stroke;
102 context.lineCap = "square"; 100 context.lineCap = "square";
103 context.stroke(); 101 context.stroke();
104 context.restore(); 102 context.restore();
105 103
106 // Layer 3 104 // Layer 3
107 105
108 stroke = aThickness; 106 stroke = aThickness;
109 stroke *= resolution; 107 stroke *= resolution;
110 if (stroke < 1.0) 108 if (stroke < 1.0)
111 stroke = Math.ceil(stroke); 109 stroke = Math.ceil(stroke);
112 else 110 else
113 stroke = Math.round(stroke); 111 stroke = Math.round(stroke);
114 stroke /= resolution; 112 stroke /= resolution;
115 alignStroke = (0.5 * stroke * resolution) % 1.0; 113 alignStroke = (0.5 * stroke * resolution) % 1.0;
116 context.save(); 114 context.save();
117 context.translate(22.5, 20.0); 115 context.translate(22.5, 20.0);
118 context.rotate(-0.071); 116 context.rotate(-0.071);