This commit is contained in:
Aakansha Doshi 2023-03-31 15:56:49 +05:30
parent f8b25375a4
commit 2ea883a05e
3 changed files with 3 additions and 7 deletions

View file

@ -272,10 +272,6 @@ export const textWysiwyg = ({
textElementWidth += 0.5;
}
let verticalOffset = 0;
if (element.verticalAlign === VERTICAL_ALIGN.BOTTOM) {
//verticalOffset = getBoundTextElementOffset(element);
}
// Make sure text editor height doesn't go beyond viewport
const editorMaxHeight =
(appState.height - viewportY) / appState.zoom.value;
@ -286,7 +282,7 @@ export const textWysiwyg = ({
width: `${textElementWidth}px`,
height: `${textElementHeight}px`,
left: `${viewportX}px`,
top: `${viewportY + verticalOffset}px`,
top: `${viewportY}px`,
transform: getTransform(
textElementWidth,
textElementHeight,

View file

@ -263,8 +263,6 @@ const drawElementOnCanvas = (
}
default: {
if (isTextElement(element)) {
//context.fillStyle = "pink";
//context.fillRect(0, 0, context.canvas.width, context.canvas.height);
const rtl = isRTL(element.text);
const shouldTemporarilyAttach = rtl && !context.canvas.isConnected;
if (shouldTemporarilyAttach) {

View file

@ -282,6 +282,7 @@ exports[`restoreElements should restore text element correctly passing value for
Object {
"angle": 0,
"backgroundColor": "transparent",
"baseline": 0,
"boundElements": Array [],
"containerId": null,
"fillStyle": "hachure",
@ -321,6 +322,7 @@ exports[`restoreElements should restore text element correctly with unknown font
Object {
"angle": 0,
"backgroundColor": "transparent",
"baseline": 0,
"boundElements": Array [],
"containerId": null,
"fillStyle": "hachure",