mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-25 02:10:38 +02:00
changed ContainerBehavior into an object {textFlow: "growing"|"fixed", margin: number}
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
getFontString,
|
||||
getUpdatedTimestamp,
|
||||
getLineHeight,
|
||||
BOUND_TEXT_PADDING,
|
||||
} from "@excalidraw/common";
|
||||
|
||||
import type { Radians } from "@excalidraw/math";
|
||||
@@ -169,7 +170,10 @@ export const newElement = (
|
||||
opts.type as ExcalidrawFlowchartNodeElement["type"],
|
||||
opts,
|
||||
),
|
||||
containerBehavior: opts.containerBehavior ?? "growing",
|
||||
containerBehavior: {
|
||||
textFlow: opts.containerBehavior?.textFlow ?? "growing",
|
||||
margin: opts.containerBehavior?.margin ?? BOUND_TEXT_PADDING,
|
||||
},
|
||||
} as NonDeleted<ExcalidrawFlowchartNodeElement>;
|
||||
}
|
||||
return _newElementBase<ExcalidrawGenericElement>(
|
||||
|
@@ -27,7 +27,10 @@ export type StrokeRoundness = "round" | "sharp";
|
||||
export type RoundnessType = ValueOf<typeof ROUNDNESS>;
|
||||
export type StrokeStyle = "solid" | "dashed" | "dotted";
|
||||
export type TextAlign = typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
|
||||
export type ContainerBehavior = "growing" | "stickyNote";
|
||||
export type ContainerBehavior = {
|
||||
textFlow: "growing" | "fixed";
|
||||
margin?: number;
|
||||
};
|
||||
|
||||
type VerticalAlignKeys = keyof typeof VERTICAL_ALIGN;
|
||||
export type VerticalAlign = typeof VERTICAL_ALIGN[VerticalAlignKeys];
|
||||
@@ -88,7 +91,7 @@ export type ExcalidrawSelectionElement = _ExcalidrawElementBase & {
|
||||
};
|
||||
|
||||
type _ExcalidrawStickyNoteContainer = _ExcalidrawElementBase & {
|
||||
containerBehavior: "stickyNote";
|
||||
containerBehavior: ContainerBehavior;
|
||||
};
|
||||
|
||||
export type ExcalidrawRectangleElement = _ExcalidrawStickyNoteContainer & {
|
||||
|
Reference in New Issue
Block a user