[mirotalksfu] - #97 - make whiteboard text editable on click

هذا الالتزام موجود في:
Miroslav Pejic
2023-03-01 19:32:55 +01:00
الأصل f0e2e29241
التزام 226db0ef7c

عرض الملف

@@ -106,6 +106,7 @@ let wbIsRedoing = false;
let wbIsEraser = false;
let wbIsBgTransparent = false;
let wbPop = [];
let coords = {};
let isButtonsVisible = false;
let isButtonsBarOver = false;
@@ -1732,34 +1733,16 @@ function whiteboardAddObj(type) {
});
break;
case 'text':
Swal.fire({
background: swalBackground,
title: 'Enter the text',
input: 'text',
showCancelButton: true,
confirmButtonText: 'OK',
showClass: {
popup: 'animate__animated animate__fadeInDown',
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => {
if (result.isConfirmed) {
let wbCanvasText = result.value;
if (wbCanvasText) {
const text = new fabric.Text(wbCanvasText, {
top: 0,
left: 0,
fontFamily: 'Comfortaa',
fill: wbCanvas.freeDrawingBrush.color,
strokeWidth: wbCanvas.freeDrawingBrush.width,
stroke: wbCanvas.freeDrawingBrush.color,
});
addWbCanvasObj(text);
}
}
const text = new fabric.IText('Lorem Ipsum', {
top: 0,
left: 0,
fontFamily: 'Comfortaa',
fontSize: 32,
fill: wbCanvas.freeDrawingBrush.color,
strokeWidth: wbCanvas.freeDrawingBrush.width,
stroke: wbCanvas.freeDrawingBrush.color,
});
addWbCanvasObj(text);
break;
case 'line':
const line = new fabric.Line([50, 100, 200, 200], {
@@ -1797,7 +1780,7 @@ function whiteboardAddObj(type) {
function addWbCanvasObj(obj) {
if (obj) {
wbCanvas.add(obj);
wbCanvas.add(obj).setActiveObject(obj);
whiteboardIsDrawingMode(false);
wbCanvasToJson();
}