fixed edit node using a 0,0 position when not intending to move node, side effect of trying to give new nodes a default position
This commit is contained in:
parent
01b41b0276
commit
b5f4571618
1 changed files with 2 additions and 3 deletions
|
@ -695,6 +695,7 @@ class Session:
|
|||
# generate name if not provided
|
||||
if not options:
|
||||
options = NodeOptions()
|
||||
options.set_position(0, 0)
|
||||
name = options.name
|
||||
if not name:
|
||||
name = f"{node_class.__name__}{_id}"
|
||||
|
@ -809,9 +810,7 @@ class Session:
|
|||
node.setposition(x, y, None)
|
||||
node.position.set_geo(lon, lat, alt)
|
||||
self.broadcast_node(node)
|
||||
else:
|
||||
if has_empty_position:
|
||||
x, y = 0, 0
|
||||
elif not has_empty_position:
|
||||
node.setposition(x, y, None)
|
||||
|
||||
def start_mobility(self, node_ids: List[int] = None) -> None:
|
||||
|
|
Loading…
Reference in a new issue