Skip to content

Commit 5aebbbd

Browse files
committed
AF-287 objects don't spawn in center of view
1 parent 7f822f0 commit 5aebbbd

File tree

1 file changed

+1
-4
lines changed
  • src/attack_flow_builder/src/assets/scripts/OpenChart/DiagramEditor/Commands/ViewEditor

1 file changed

+1
-4
lines changed

src/attack_flow_builder/src/assets/scripts/OpenChart/DiagramEditor/Commands/ViewEditor/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,7 @@ export function spawnObject(
137137
export function spawnObjectAtInterfaceCenter(
138138
editor: DiagramViewEditor, id: string
139139
): GroupCommand {
140-
const ui = editor.interface;
141-
const camera = editor.file.camera;
142-
const x = ((ui.width / 2) - camera.x) / camera.k;
143-
const y = ((ui.height / 2) - camera.y) / camera.k;
140+
const { x, y } = editor.file.camera;
144141
return spawnObject(editor, id, x, y);
145142
}
146143

0 commit comments

Comments
 (0)