updated grpc node positions to use floats, avoids needing to deal with int conversions

This commit is contained in:
Blake Harnden 2019-12-13 10:47:23 -08:00
parent 9c302e8bc6
commit 819954a695
6 changed files with 12 additions and 33 deletions

View file

@ -140,8 +140,8 @@ class CanvasNode:
# set actual coords for node and update core is running
real_x, real_y = self.canvas.get_actual_coords(x, y)
self.core_node.position.x = int(real_x)
self.core_node.position.y = int(real_y)
self.core_node.position.x = real_x
self.core_node.position.y = real_y
if self.app.core.is_runtime() and update:
self.app.core.edit_node(self.core_node)
@ -164,11 +164,6 @@ class CanvasNode:
else:
self.show_config()
def update_coords(self):
x, y = self.canvas.coords(self.id)
self.core_node.position.x = int(x)
self.core_node.position.y = int(y)
def create_context(self):
is_wlan = self.core_node.type == NodeType.WIRELESS_LAN
is_emane = self.core_node.type == NodeType.EMANE