feat(home): update projects button text and image

This commit is contained in:
2026-01-07 11:20:17 +01:00
parent 5e3336bbe8
commit 1cf4bfcc8f
4 changed files with 47 additions and 0 deletions

View File

@@ -13,6 +13,18 @@ export const fillTextCentered = (
return measure.actualBoundingBoxAscent + measure.actualBoundingBoxDescent + 1;
};
export const fillTextHCentered = (
ctx: CanvasRenderingContext2D,
text: string,
x: number,
y: number,
width: number,
) => {
const measure = ctx.measureText(text);
const textX = Math.floor(x + width / 2 - measure.actualBoundingBoxRight / 2);
ctx.fillText(text, textX, y);
};
export const fillTextWordWrapped = (
ctx: CanvasRenderingContext2D,
text: string,