Bigger wind font for higher resolution map

This commit is contained in:
Guntis Smaukstelis
2024-02-12 15:57:16 +02:00
parent b49bd50dfd
commit 4cc2bb9a87
2 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ export function drawOnMap(
if (!props.showWind) return;
// wind values
ctx.font = "bold 45px Rubik";
ctx.font = `bold ${props.windFontSize}px Rubik`;
ctx.textAlign = "left";
ctx.textBaseline = "top";
ctx.fillStyle = "#FFFFFF";
@@ -70,7 +70,7 @@ export function drawOnMap(
ctx.font = "bold 25px Rubik";
ctx.fillText("M/S", windProp.offsetX + boxMiddleX + speedWidth / 2 - 22, (windProp.offsetY + 590)*windProp.scaleY);
ctx.font = "bold 45px Rubik";
ctx.font = `bold ${props.windFontSize}px Rubik`;
const gustsWidth = ctx.measureText(windGusts).width;
ctx.fillText(windGusts, windProp.offsetX + boxMiddleX - gustsWidth / 2 - 30, (windProp.offsetY + 790)*windProp.scaleY);
ctx.font = "bold 25px Rubik";