1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2026-03-14 13:55:44 +01:00

watermark: la taille du texte de l'overlay ne bouge plus au zoom

This commit is contained in:
Gabriel Poma 2025-06-23 18:09:49 +02:00
commit d409308075

View file

@ -781,7 +781,10 @@ function createEventsListener() {
setIsChanged(hasModifications || !!e.target.value)
canvasEditions.forEach(function (canvas) {
const text = new fabric.Text(e.target.value, {angle: -40, fill: "#0009"})
// Pourquoi 27 : 40 / 1.5 = 26.6666
// fontSize ^ ^ currentScale par défaut
// Comme ça le texte de l'overlay ne bouge pas au zoom
const text = new fabric.Text(e.target.value, {angle: -40, fill: "#0009", fontSize: 27 * currentScale})
const overlay = new fabric.Rect({
fill: new fabric.Pattern({source: text.toCanvasElement(), repeat: 'repeat'}),
height: canvas.height,