mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix
This commit is contained in:
parent
f8b25375a4
commit
2ea883a05e
3 changed files with 3 additions and 7 deletions
|
@ -272,10 +272,6 @@ export const textWysiwyg = ({
|
||||||
textElementWidth += 0.5;
|
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
|
// Make sure text editor height doesn't go beyond viewport
|
||||||
const editorMaxHeight =
|
const editorMaxHeight =
|
||||||
(appState.height - viewportY) / appState.zoom.value;
|
(appState.height - viewportY) / appState.zoom.value;
|
||||||
|
@ -286,7 +282,7 @@ export const textWysiwyg = ({
|
||||||
width: `${textElementWidth}px`,
|
width: `${textElementWidth}px`,
|
||||||
height: `${textElementHeight}px`,
|
height: `${textElementHeight}px`,
|
||||||
left: `${viewportX}px`,
|
left: `${viewportX}px`,
|
||||||
top: `${viewportY + verticalOffset}px`,
|
top: `${viewportY}px`,
|
||||||
transform: getTransform(
|
transform: getTransform(
|
||||||
textElementWidth,
|
textElementWidth,
|
||||||
textElementHeight,
|
textElementHeight,
|
||||||
|
|
|
@ -263,8 +263,6 @@ const drawElementOnCanvas = (
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if (isTextElement(element)) {
|
if (isTextElement(element)) {
|
||||||
//context.fillStyle = "pink";
|
|
||||||
//context.fillRect(0, 0, context.canvas.width, context.canvas.height);
|
|
||||||
const rtl = isRTL(element.text);
|
const rtl = isRTL(element.text);
|
||||||
const shouldTemporarilyAttach = rtl && !context.canvas.isConnected;
|
const shouldTemporarilyAttach = rtl && !context.canvas.isConnected;
|
||||||
if (shouldTemporarilyAttach) {
|
if (shouldTemporarilyAttach) {
|
||||||
|
|
|
@ -282,6 +282,7 @@ exports[`restoreElements should restore text element correctly passing value for
|
||||||
Object {
|
Object {
|
||||||
"angle": 0,
|
"angle": 0,
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
|
"baseline": 0,
|
||||||
"boundElements": Array [],
|
"boundElements": Array [],
|
||||||
"containerId": null,
|
"containerId": null,
|
||||||
"fillStyle": "hachure",
|
"fillStyle": "hachure",
|
||||||
|
@ -321,6 +322,7 @@ exports[`restoreElements should restore text element correctly with unknown font
|
||||||
Object {
|
Object {
|
||||||
"angle": 0,
|
"angle": 0,
|
||||||
"backgroundColor": "transparent",
|
"backgroundColor": "transparent",
|
||||||
|
"baseline": 0,
|
||||||
"boundElements": Array [],
|
"boundElements": Array [],
|
||||||
"containerId": null,
|
"containerId": null,
|
||||||
"fillStyle": "hachure",
|
"fillStyle": "hachure",
|
||||||
|
|
Loading…
Add table
Reference in a new issue