Add water temperature production workspace
This commit is contained in:
@@ -28,7 +28,7 @@ export function drawOnMap(
|
||||
const numericValue = roundValues ? Math.round(value) : value.toFixed(1);
|
||||
const stringValue = numericValue.toString().replace(".", ",");
|
||||
|
||||
ctx.font = `bold ${props.fontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.fontSize}px Monda`;
|
||||
const badgeWidth = getBadgeWidth(ctx, stringValue, props);
|
||||
ctx.fillStyle = "#FFFFFF";
|
||||
ctx.fillRect(localX - badgeWidth / 2, localY - props.boxSize / 2, badgeWidth, props.boxSize);
|
||||
@@ -39,7 +39,7 @@ export function drawOnMap(
|
||||
const localX = props.offsetX + x * props.scale;
|
||||
const localY = props.offsetY + y * props.scale;
|
||||
|
||||
ctx.font = `bold ${props.fontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.fontSize}px Monda`;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillStyle = "#000000";
|
||||
@@ -75,7 +75,7 @@ export function drawOnMap(
|
||||
if (!props.showWind) return;
|
||||
|
||||
// wind values
|
||||
ctx.font = `bold ${props.windFontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.windFontSize}px Monda`;
|
||||
ctx.textAlign = "left";
|
||||
ctx.textBaseline = "top";
|
||||
ctx.fillStyle = "#FFFFFF";
|
||||
@@ -88,18 +88,18 @@ export function drawOnMap(
|
||||
|
||||
const speedWidth = ctx.measureText(windSpeed).width;
|
||||
ctx.fillText(windSpeed, windProp.offsetX + boxMiddleX - speedWidth / 2 - 30, (windProp.offsetY + 575)*windProp.scaleY);
|
||||
ctx.font = "bold 25px Rubik";
|
||||
ctx.font = "bold 25px Monda";
|
||||
ctx.fillText("M/S", windProp.offsetX + boxMiddleX + speedWidth / 2 - 22, (windProp.offsetY + 590)*windProp.scaleY);
|
||||
|
||||
ctx.font = `bold ${props.windFontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.windFontSize}px Monda`;
|
||||
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";
|
||||
ctx.font = "bold 25px Monda";
|
||||
ctx.fillText("M/S", windProp.offsetX + boxMiddleX + gustsWidth / 2 - 22, (windProp.offsetY + 805)*windProp.scaleY);
|
||||
}
|
||||
|
||||
function getBadgeWidth(ctx: CanvasRenderingContext2D, value: string, props: ResolutionPropsValue, restoreValueFont = false): number {
|
||||
if (restoreValueFont) ctx.font = `bold ${props.fontSize}px Rubik`;
|
||||
if (restoreValueFont) ctx.font = `bold ${props.fontSize}px Monda`;
|
||||
const width = Math.max(props.boxSize, Math.ceil(ctx.measureText(value).width + props.fontSize * 0.8));
|
||||
if (restoreValueFont) ctx.font = `normal ${props.fontSize * 4.2}px Daira by LTV grafika`;
|
||||
return width;
|
||||
@@ -126,7 +126,7 @@ function drawTitleOverlay(ctx: CanvasRenderingContext2D, title: string, source:
|
||||
|
||||
ctx.textAlign = "left";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.font = `bold ${30 * scale}px Rubik`;
|
||||
ctx.font = `bold ${30 * scale}px Monda`;
|
||||
const titleText = title.trim().toUpperCase();
|
||||
const titleWidth = Math.max(360 * scale, ctx.measureText(titleText).width + horizontalPadding * 2);
|
||||
const titleX = canvasWidth - right - titleWidth;
|
||||
@@ -137,7 +137,7 @@ function drawTitleOverlay(ctx: CanvasRenderingContext2D, title: string, source:
|
||||
ctx.fillText(titleText, titleX + horizontalPadding, top + titleHeight / 2);
|
||||
|
||||
if (source.trim()) {
|
||||
ctx.font = `bold ${19 * scale}px Rubik`;
|
||||
ctx.font = `bold ${19 * scale}px Monda`;
|
||||
const sourceText = source.trim().toUpperCase();
|
||||
const sourceWidth = Math.max(130 * scale, ctx.measureText(sourceText).width + horizontalPadding * 2);
|
||||
const sourceX = canvasWidth - right - sourceWidth;
|
||||
|
||||
Reference in New Issue
Block a user