Browse Source

Fix changing favicon on macOS

Fix favicon font size with DPR
master
morethanwords 4 years ago
parent
commit
3a8f5df201
  1. 2
      src/index.hbs
  2. 6
      src/lib/appManagers/appNotificationsManager.ts

2
src/index.hbs

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="assets/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicon-16x16.png">
<!--<link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicon-16x16.png">-->
<link rel="manifest" href="site.webmanifest">
<link rel="mask-icon" href="assets/img/safari-pinned-tab.svg" color="#64a3f0">
<meta name="msapplication-TileColor" content="#da532c">

6
src/lib/appManagers/appNotificationsManager.ts

@ -239,14 +239,16 @@ export class AppNotificationsManager { @@ -239,14 +239,16 @@ export class AppNotificationsManager {
fontSize = 20;
} else {
str = '99+';
fontSize = 18;
fontSize = 16;
}
fontSize *= window.devicePixelRatio;
ctx.font = `700 ${fontSize}px ${fontFamily}`;
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
ctx.fillStyle = 'white';
ctx.fillText('' + this.notificationsCount, canvas.width / 2, canvas.height * .5625);
ctx.fillText(str, canvas.width / 2, canvas.height * .5625);
/* const ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, canvas.width, canvas.height); */

Loading…
Cancel
Save