feat(home): update projects button text and image
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user