mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2025-12-25 15:39:35 -05:00
feat: ensures connectors have start and end nodes
This commit is contained in:
@@ -88,8 +88,14 @@ export const Connector: ModeActions = {
|
||||
if (uiState.mode.type !== 'CONNECTOR' || !uiState.mode.id) return;
|
||||
|
||||
const connector = getItemByIdOrThrow(scene.connectors, uiState.mode.id);
|
||||
const firstAnchor = connector.value.anchors[0];
|
||||
const lastAnchor =
|
||||
connector.value.anchors[connector.value.anchors.length - 1];
|
||||
|
||||
if (connector.value.path.tiles.length < 2) {
|
||||
if (
|
||||
connector.value.path.tiles.length < 2 ||
|
||||
!(firstAnchor.ref.item && lastAnchor.ref.item)
|
||||
) {
|
||||
scene.deleteConnector(uiState.mode.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user