Merge remote-tracking branch 'origin/master' into aakansha-no-trailing-space-render-text-container
This commit is contained in:
@@ -45,9 +45,9 @@ import {
|
||||
getContainerCoords,
|
||||
getContainerElement,
|
||||
getLineHeightInPx,
|
||||
getBoundTextMaxHeight,
|
||||
getBoundTextMaxWidth,
|
||||
getLineWidth,
|
||||
getMaxContainerHeight,
|
||||
getMaxContainerWidth,
|
||||
} from "../element/textElement";
|
||||
import { LinearElementEditor } from "../element/linearElementEditor";
|
||||
|
||||
@@ -346,7 +346,7 @@ const drawElementOnCanvas = (
|
||||
getLineWidth(lines[index], font) -
|
||||
getLineWidth(lines[index].trimEnd(), font);
|
||||
const maxWidth = container
|
||||
? getMaxContainerWidth(container)
|
||||
? getBoundTextMaxWidth(container)
|
||||
: element.width;
|
||||
const availableWidth =
|
||||
maxWidth - getLineWidth(lines[index].trimEnd(), font);
|
||||
@@ -889,14 +889,17 @@ const drawElementFromCanvas = (
|
||||
"true" &&
|
||||
hasBoundTextElement(element)
|
||||
) {
|
||||
const textElement = getBoundTextElement(
|
||||
element,
|
||||
) as ExcalidrawTextElementWithContainer;
|
||||
const coords = getContainerCoords(element);
|
||||
context.strokeStyle = "#c92a2a";
|
||||
context.lineWidth = 3;
|
||||
context.strokeRect(
|
||||
(coords.x + renderConfig.scrollX) * window.devicePixelRatio,
|
||||
(coords.y + renderConfig.scrollY) * window.devicePixelRatio,
|
||||
getMaxContainerWidth(element) * window.devicePixelRatio,
|
||||
getMaxContainerHeight(element) * window.devicePixelRatio,
|
||||
getBoundTextMaxWidth(element) * window.devicePixelRatio,
|
||||
getBoundTextMaxHeight(element, textElement) * window.devicePixelRatio,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user