mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: binding text to non-bindable containers and not always preferring selection (#4655)
This commit is contained in:
parent
8e26d5b500
commit
6d0716eb6b
13 changed files with 336 additions and 85 deletions
|
@ -22,7 +22,6 @@ import { getElementAbsoluteCoords } from ".";
|
|||
import { adjustXYWithRotation } from "../math";
|
||||
import { getResizedElementAbsoluteCoords } from "./bounds";
|
||||
import { getContainerElement, measureText, wrapText } from "./textElement";
|
||||
import { isBoundToContainer } from "./typeChecks";
|
||||
import { BOUND_TEXT_PADDING, VERTICAL_ALIGN } from "../constants";
|
||||
|
||||
type ElementConstructorOpts = MarkOptional<
|
||||
|
@ -221,8 +220,7 @@ const getAdjustedDimensions = (
|
|||
|
||||
// make sure container dimensions are set properly when
|
||||
// text editor overflows beyond viewport dimensions
|
||||
if (isBoundToContainer(element)) {
|
||||
const container = getContainerElement(element)!;
|
||||
if (container) {
|
||||
let height = container.height;
|
||||
let width = container.width;
|
||||
if (nextHeight > height - BOUND_TEXT_PADDING * 2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue