Add 39px icon drawing for browserAction. Fix #41.

This commit is contained in:
FelisCatus 2015-01-30 20:16:53 +08:00
parent fabb7059f8
commit fa66421640
4 changed files with 56 additions and 1 deletions

View File

@ -33,11 +33,16 @@ drawIcon = (resultColor, profileColor) ->
icon = iconCache[cacheKey]
return icon if icon
ctx = document.getElementById('canvas-icon').getContext('2d')
ctx2x = document.getElementById('canvas-icon-2x').getContext('2d')
if resultColor?
drawOmega ctx, resultColor, profileColor
drawOmega2x ctx2x, resultColor, profileColor
else
drawOmega ctx, profileColor
icon = ctx.getImageData(0, 0, 19, 19)
drawOmega2x ctx2x, profileColor
icon =
19: ctx.getImageData(0, 0, 19, 19)
38: ctx2x.getImageData(0, 0, 38, 38)
return iconCache[cacheKey] = icon
charCodeUnderscore = '_'.charCodeAt(0)

View File

@ -6,12 +6,14 @@
</head>
<body>
<canvas id="canvas-icon"></canvas>
<canvas id="canvas-icon-2x"></canvas>
<script src="js/log_error.js"></script>
<script src="js/background_preload.js"></script>
<script src="js/omega_pac.min.js"></script>
<script src="js/omega_target.min.js"></script>
<script src="js/omega_target_chromium_extension.min.js"></script>
<script src="img/icons/omega_svg.js"></script>
<script src="img/icons/omega-2x_svg.js"></script>
<script src="js/background.js"></script>
</body>
</html>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg
xmlns="http://www.w3.org/2000/svg"
width="38"
height="38"
version="1.1">
<path
d="m 28.091374,19.0002 c 0,4.909654 -4.070348,8.889716 -9.091374,8.889716 -5.021027,0 -9.0913735,-3.980062 -9.0913735,-8.889716 0,-4.909654 4.0703465,-8.889716 9.0913735,-8.889716 5.021026,0 9.091374,3.980062 9.091374,8.889716 z M 36.077892,19 C 36.077892,28.222652 28.431858,35.699084 19,35.699084 9.5681407,35.699084 1.922108,28.22265 1.922108,19 1.922108,9.77735 9.5681407,2.300916 19,2.300916 28.431858,2.300916 36.077892,9.77735 36.077892,19 z"
fill-rule="evenodd"
class="profile-color"
fill="#31afec"
stroke="none"
id="profile-circle" />
</svg>

After

Width:  |  Height:  |  Size: 718 B

View File

@ -0,0 +1,34 @@
var drawOmega2x = function (ctx, outerCircleColor, innerCircleColor) {
ctx.clearRect(0,0,38,38);
ctx.lineCap = 'butt';
ctx.lineJoin = 'miter';
ctx.miterLimit = 4;
if (innerCircleColor != null) {
ctx.fillStyle = innerCircleColor;
ctx.moveTo(36.077892,19);
ctx.bezierCurveTo(36.077892,28.222652,28.431858,35.699084,19,35.699084);
ctx.bezierCurveTo(9.5681407,35.699084,1.922108,28.22265,1.922108,19);
ctx.bezierCurveTo(1.922108,9.77735,9.5681407,2.300916,19,2.300916);
ctx.bezierCurveTo(28.431858,2.300916,36.077892,9.77735,36.077892,19);
ctx.closePath();
ctx.fill();
}
ctx.fillStyle = outerCircleColor;
ctx.beginPath();
ctx.moveTo(28.091374,19.0002);
ctx.bezierCurveTo(28.091374,23.909854,24.021026,27.889916,19,27.889916);
ctx.bezierCurveTo(13.978973,27.889916,9.9086265,23.909854,9.9086265,19.0002);
ctx.bezierCurveTo(9.9086265,14.090546,13.978973,10.110484,19,10.110484);
ctx.bezierCurveTo(24.021026,10.110484,28.091374000000002,14.090546,28.091374000000002,19.0002);
ctx.closePath();
ctx.moveTo(36.077892,19);
ctx.bezierCurveTo(36.077892,28.222652,28.431858,35.699084,19,35.699084);
ctx.bezierCurveTo(9.5681407,35.699084,1.922108,28.22265,1.922108,19);
ctx.bezierCurveTo(1.922108,9.77735,9.5681407,2.300916,19,2.300916);
ctx.bezierCurveTo(28.431858,2.300916,36.077892,9.77735,36.077892,19);
ctx.closePath();
ctx.fill('evenodd');
};