mirror of
https://github.com/excalidraw/excalidraw
synced 2025-07-25 13:58:22 +08:00
Remove invariants from debug
feat: expose `applyTo` options, don't commit empty text element (#9744) * Expose applyTo options, skip re-draw for empty text * Don't commit empty text elements test: added test file for distribute (#9754)
This commit is contained in:
@ -188,13 +188,6 @@ const renderBindings = (
|
||||
}
|
||||
|
||||
if (element.endBinding) {
|
||||
invariant(
|
||||
elementsMap
|
||||
.get(element.endBinding.elementId)
|
||||
?.boundElements?.find((e) => e.id === element.id),
|
||||
"Missing record in boundElements for arrow",
|
||||
);
|
||||
|
||||
_renderBinding(
|
||||
context,
|
||||
element.endBinding,
|
||||
@ -217,17 +210,7 @@ const renderBindings = (
|
||||
boundElement.id,
|
||||
) as ExcalidrawArrowElement;
|
||||
|
||||
invariant(
|
||||
arrow,
|
||||
"Arrow element registered as a bound object not found in elementsMap",
|
||||
);
|
||||
invariant(
|
||||
arrow.startBinding?.elementId === element.id ||
|
||||
arrow.endBinding?.elementId === element.id,
|
||||
"Arrow element registered as a bound object not found in binding on the arrow element",
|
||||
);
|
||||
|
||||
if (arrow.startBinding?.elementId === element.id) {
|
||||
if (arrow && arrow.startBinding?.elementId === element.id) {
|
||||
_renderBindableBinding(
|
||||
arrow.startBinding,
|
||||
context,
|
||||
@ -238,7 +221,7 @@ const renderBindings = (
|
||||
"green",
|
||||
);
|
||||
}
|
||||
if (arrow.endBinding?.elementId === element.id) {
|
||||
if (arrow && arrow.endBinding?.elementId === element.id) {
|
||||
_renderBindableBinding(
|
||||
arrow.endBinding,
|
||||
context,
|
||||
|
Reference in New Issue
Block a user