mirror of
https://github.com/24eme/signaturepdf
synced 2026-03-14 13:55:44 +01:00
add new line with ctrl+Enter
This commit is contained in:
parent
ac63d9de2a
commit
2d2df03cb4
1 changed files with 13 additions and 1 deletions
|
|
@ -550,8 +550,20 @@ function createAndAddSvgInCanvas(canvas, item, x, y, height = null) {
|
|||
fill: penColor
|
||||
});
|
||||
|
||||
fabric.Textbox.prototype.customEnterAction = function (e) {
|
||||
if (e.ctrlKey) {
|
||||
this.insertChars('\n', undefined, this.selectionStart)
|
||||
this.exitEditing();
|
||||
this.enterEditing();
|
||||
this.moveCursorRight(e);
|
||||
return
|
||||
}
|
||||
|
||||
this.exitEditing()
|
||||
}
|
||||
|
||||
addObjectInCanvas(canvas, textbox).setActiveObject(textbox);
|
||||
textbox.keysMap[13] = "exitEditing";
|
||||
textbox.keysMap[13] = "customEnterAction";
|
||||
textbox.lockScalingFlip = true;
|
||||
textbox.scaleX = currentTextScale;
|
||||
textbox.scaleY = currentTextScale;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue