[mirotalksfu] - #97 - make whiteboard text editable on click
هذا الالتزام موجود في:
@@ -106,6 +106,7 @@ let wbIsRedoing = false;
|
|||||||
let wbIsEraser = false;
|
let wbIsEraser = false;
|
||||||
let wbIsBgTransparent = false;
|
let wbIsBgTransparent = false;
|
||||||
let wbPop = [];
|
let wbPop = [];
|
||||||
|
let coords = {};
|
||||||
|
|
||||||
let isButtonsVisible = false;
|
let isButtonsVisible = false;
|
||||||
let isButtonsBarOver = false;
|
let isButtonsBarOver = false;
|
||||||
@@ -1732,34 +1733,16 @@ function whiteboardAddObj(type) {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
Swal.fire({
|
const text = new fabric.IText('Lorem Ipsum', {
|
||||||
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,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
fontFamily: 'Comfortaa',
|
fontFamily: 'Comfortaa',
|
||||||
|
fontSize: 32,
|
||||||
fill: wbCanvas.freeDrawingBrush.color,
|
fill: wbCanvas.freeDrawingBrush.color,
|
||||||
strokeWidth: wbCanvas.freeDrawingBrush.width,
|
strokeWidth: wbCanvas.freeDrawingBrush.width,
|
||||||
stroke: wbCanvas.freeDrawingBrush.color,
|
stroke: wbCanvas.freeDrawingBrush.color,
|
||||||
});
|
});
|
||||||
addWbCanvasObj(text);
|
addWbCanvasObj(text);
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case 'line':
|
case 'line':
|
||||||
const line = new fabric.Line([50, 100, 200, 200], {
|
const line = new fabric.Line([50, 100, 200, 200], {
|
||||||
@@ -1797,7 +1780,7 @@ function whiteboardAddObj(type) {
|
|||||||
|
|
||||||
function addWbCanvasObj(obj) {
|
function addWbCanvasObj(obj) {
|
||||||
if (obj) {
|
if (obj) {
|
||||||
wbCanvas.add(obj);
|
wbCanvas.add(obj).setActiveObject(obj);
|
||||||
whiteboardIsDrawingMode(false);
|
whiteboardIsDrawingMode(false);
|
||||||
wbCanvasToJson();
|
wbCanvasToJson();
|
||||||
}
|
}
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم