shape
This commit is contained in:
parent
0f6cca1194
commit
2fc8782360
2 changed files with 5 additions and 4 deletions
|
@ -366,9 +366,9 @@ class CanvasGraph(tk.Canvas):
|
||||||
self.core.delete_graph_nodes(nodes)
|
self.core.delete_graph_nodes(nodes)
|
||||||
|
|
||||||
def add_node(self, x, y):
|
def add_node(self, x, y):
|
||||||
plot_id = self.find_all()[0]
|
canvas_id = self.find_all()[0]
|
||||||
logging.info("add node event: %s - %s", plot_id, self.selected)
|
logging.info("add node event: %s - %s", canvas_id, self.selected)
|
||||||
if self.selected == plot_id:
|
if self.selected == canvas_id:
|
||||||
core_node = self.core.create_node(
|
core_node = self.core.create_node(
|
||||||
int(x), int(y), self.node_draw.node_type, self.node_draw.model
|
int(x), int(y), self.node_draw.node_type, self.node_draw.model
|
||||||
)
|
)
|
||||||
|
@ -651,7 +651,7 @@ class CanvasNode:
|
||||||
self.moving = None
|
self.moving = None
|
||||||
|
|
||||||
def motion(self, event):
|
def motion(self, event):
|
||||||
if self.canvas.mode == GraphMode.EDGE or self.canvas.mode == GraphMode.NODE:
|
if self.canvas.mode == GraphMode.EDGE:
|
||||||
return
|
return
|
||||||
x, y = self.canvas.canvas_xy(event)
|
x, y = self.canvas.canvas_xy(event)
|
||||||
moving_x, moving_y = self.moving
|
moving_x, moving_y = self.moving
|
||||||
|
|
|
@ -10,6 +10,7 @@ class Shape:
|
||||||
self.canvas = canvas
|
self.canvas = canvas
|
||||||
self.x0 = topleft_x
|
self.x0 = topleft_x
|
||||||
self.y0 = topleft_y
|
self.y0 = topleft_y
|
||||||
|
# imageenum = self.app.toolbar
|
||||||
self.id = self.canvas.create_oval(
|
self.id = self.canvas.create_oval(
|
||||||
topleft_x, topleft_y, topleft_x + 30, topleft_y + 30
|
topleft_x, topleft_y, topleft_x + 30, topleft_y + 30
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue