From 5e66d42f596fd2c02cf7ed7b74d5d57686ce2f13 Mon Sep 17 00:00:00 2001 From: Richard Grimes <34091455+TheScienceotter@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:50:17 +0100 Subject: [PATCH] Position of watermark text now calculated in polar coordinates Watermark text will now appear to rotate around the page centre, rather than at the bottom corner of the text element. --- src/js/logic/add-watermark-page.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/logic/add-watermark-page.ts b/src/js/logic/add-watermark-page.ts index 7d366c9..3f503c4 100644 --- a/src/js/logic/add-watermark-page.ts +++ b/src/js/logic/add-watermark-page.ts @@ -178,8 +178,8 @@ async function addWatermark() { const textWidth = watermarkAsset.widthOfTextAtSize(text, fontSize); page.drawText(text, { - x: (width - textWidth) / 2, - y: height / 2, + x: (width / 2) - ((textWidth / 2) * Math.cos(angle * Math.PI / 180)), + y: (height / 2) - ((textWidth / 2) * Math.sin(angle * Math.PI / 180)), font: watermarkAsset, size: fontSize, color: rgb(textColor.r, textColor.g, textColor.b),