fix: binding text to non-bindable containers and not always preferring selection (#4655)
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user