Skip to content

Commit

Permalink
chore: simplify line-break regexes, separate text wrapping (excalidra…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrazator authored Oct 30, 2024
1 parent dfaaff4 commit 2734e64
Show file tree
Hide file tree
Showing 11 changed files with 1,213 additions and 1,039 deletions.
2 changes: 1 addition & 1 deletion packages/excalidraw/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ import {
isValidTextContainer,
measureText,
normalizeText,
wrapText,
} from "../element/textElement";
import {
showHyperlinkTooltip,
Expand Down Expand Up @@ -461,6 +460,7 @@ import {
vectorNormalize,
} from "../../math";
import { cropElement } from "../element/cropElement";
import { wrapText } from "../element/textWrapping";

const AppContext = React.createContext<AppClassProperties>(null!);
const AppPropsContext = React.createContext<AppProps>(null!);
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/element/embeddable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ExcalidrawProps } from "../types";
import { getFontString, updateActiveTool } from "../utils";
import { setCursorForShape } from "../cursor";
import { newTextElement } from "./newElement";
import { wrapText } from "./textElement";
import { wrapText } from "./textWrapping";
import { isIframeElement } from "./typeChecks";
import type {
ExcalidrawElement,
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/element/newElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import { getResizedElementAbsoluteCoords } from "./bounds";
import {
measureText,
normalizeText,
wrapText,
getBoundTextMaxWidth,
} from "./textElement";
import { wrapText } from "./textWrapping";
import {
DEFAULT_ELEMENT_PROPS,
DEFAULT_FONT_FAMILY,
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/element/resizeElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ import {
handleBindTextResize,
getBoundTextMaxWidth,
getApproxMinLineHeight,
wrapText,
measureText,
getMinTextElementWidth,
} from "./textElement";
import { wrapText } from "./textWrapping";
import { LinearElementEditor } from "./linearElementEditor";
import { isInGroup } from "../groups";
import { mutateElbowArrow } from "./routing";
Expand Down
Loading

0 comments on commit 2734e64

Please sign in to comment.