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:
parent
8ce7fda9b4
commit
d409308075
1 changed files with 4 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue