Upsize svg identicons

The chrome.notifications api renders iconUrls at full bleed, as opposed
to the Web Notifications api, which adds padding. This was causing our
identicons to look a bit over stretched.

Fixed by rendering them a bit larger and with some padding.

// FREEBIE
This commit is contained in:
lilia 2015-09-14 11:39:42 -07:00
parent 1a30d003f5
commit e80fa187ba
2 changed files with 4 additions and 4 deletions

View file

@ -88,9 +88,9 @@
</div> </div>
</script> </script>
<script type='text/x-tmpl-mustache' id='identicon-svg'> <script type='text/x-tmpl-mustache' id='identicon-svg'>
<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44"> <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<circle cx="22" cy="22" r="22" fill="{{ color }}" /> <circle cx="50" cy="50" r="40" fill="{{ color }}" />
<text text-anchor="middle" fill="white" font-size="14px" x="22" y="22" baseline-shift="-4px"> <text text-anchor="middle" fill="white" font-size="24px" x="50" y="50" baseline-shift="-8px">
{{ content }} {{ content }}
</text> </text>
</svg> </svg>

View file

@ -24,7 +24,7 @@
var img = document.createElement('img'); var img = document.createElement('img');
img.onload = function () { img.onload = function () {
var canvas = loadImage.scale(img, { var canvas = loadImage.scale(img, {
canvas: true, maxWidth: 44, maxHeight: 44 canvas: true, maxWidth: 100, maxHeight: 100
}); });
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0); ctx.drawImage(img, 0, 0);