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
|
@ -14,6 +14,7 @@ import util from "util";
|
|||
import path from "path";
|
||||
import { getMimeType } from "../../data/blob";
|
||||
import { newFreeDrawElement } from "../../element/newElement";
|
||||
import { Point } from "../../types";
|
||||
|
||||
const readFile = util.promisify(fs.readFile);
|
||||
|
||||
|
@ -98,6 +99,7 @@ export class API {
|
|||
containerId?: T extends "text"
|
||||
? ExcalidrawTextElement["containerId"]
|
||||
: never;
|
||||
points?: T extends "arrow" | "line" ? readonly Point[] : never;
|
||||
}): T extends "arrow" | "line"
|
||||
? ExcalidrawLinearElement
|
||||
: T extends "freedraw"
|
||||
|
@ -158,10 +160,13 @@ export class API {
|
|||
case "arrow":
|
||||
case "line":
|
||||
element = newLinearElement({
|
||||
...base,
|
||||
width,
|
||||
height,
|
||||
type: type as "arrow" | "line",
|
||||
startArrowhead: null,
|
||||
endArrowhead: null,
|
||||
...base,
|
||||
points: rest.points ?? [],
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue