|
|
@@ -1,7 +1,7 @@
|
|
|
"""
|
|
|
Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
|
|
|
|
|
|
-Date: Wed Sep 13 15:54:04 2017
|
|
|
+Date: Thu Sep 14 11:21:54 2017
|
|
|
|
|
|
Model author: Yentl Van Tendeloo and Addis Gebremichael
|
|
|
Model name: Modelverse Visual Editor - Tkinter Version
|
|
|
@@ -5791,11 +5791,9 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
|
|
|
|
|
|
def _update_mv_x_enter(self):
|
|
|
self.big_step.outputEventOM(Event("broad_cast", None, [self, Event("mv_request", None, ['attr_assign', [current_rendered_model, self.tmp['mv_id'], 'x', self.tmp['x']]])]))
|
|
|
- print("Update X")
|
|
|
|
|
|
def _update_mv_y_enter(self):
|
|
|
self.big_step.outputEventOM(Event("broad_cast", None, [self, Event("mv_request", None, ['attr_assign', [current_rendered_model, self.tmp['mv_id'], 'y', self.tmp['y']]])]))
|
|
|
- print("Update Y")
|
|
|
|
|
|
def _main_0_exec(self, parameters):
|
|
|
element = parameters[0]
|
|
|
@@ -5818,6 +5816,8 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
|
|
|
def _main_1_exec(self, parameters):
|
|
|
ID = parameters[0]
|
|
|
self.original_coords = self.last_x, self.last_y
|
|
|
+ self.prev_x = self.last_x
|
|
|
+ self.prev_y = self.last_y
|
|
|
|
|
|
def _main_1_guard(self, parameters):
|
|
|
ID = parameters[0]
|
|
|
@@ -5825,10 +5825,13 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
|
|
|
|
|
|
def _dragging_0_exec(self, parameters):
|
|
|
ID = parameters[0]
|
|
|
+ delta_x = self.prev_x - self.last_x
|
|
|
+ delta_y = self.prev_y - self.last_y
|
|
|
+
|
|
|
for f in self.elements:
|
|
|
old_coords = self.containing_canvas.coords(f)
|
|
|
- new_x = self.coordinates[0] - self.original_coords[0] + self.last_x
|
|
|
- new_y = self.coordinates[1] - self.original_coords[1] + self.last_y
|
|
|
+ new_x = old_coords[0] - delta_x
|
|
|
+ new_y = old_coords[1] - delta_y
|
|
|
|
|
|
if len(old_coords) == 2:
|
|
|
self.containing_canvas.coords(f, (new_x, new_y))
|
|
|
@@ -5836,6 +5839,8 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
|
|
|
height = old_coords[3] - old_coords[1]
|
|
|
width = old_coords[2] - old_coords[0]
|
|
|
self.containing_canvas.coords(f, (new_x, new_y, new_x + width, new_y + height))
|
|
|
+ self.prev_x = self.last_x
|
|
|
+ self.prev_y = self.last_y
|
|
|
|
|
|
def _dragging_0_guard(self, parameters):
|
|
|
ID = parameters[0]
|
|
|
@@ -5843,7 +5848,10 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
|
|
|
|
|
|
def _dragging_1_exec(self, parameters):
|
|
|
ID = parameters[0]
|
|
|
- self.coordinates = self.coordinates[0] - (self.original_coords[0] - self.last_x), self.coordinates[1] - (self.original_coords[1] - self.last_y)
|
|
|
+ delta_x = self.original_coords[0] - self.last_x
|
|
|
+ delta_y = self.original_coords[1] - self.last_y
|
|
|
+
|
|
|
+ self.coordinates = self.coordinates[0] + delta_x, self.coordinates[1] + delta_y
|
|
|
self.to_update = dict(self.elements)
|
|
|
|
|
|
def _dragging_1_guard(self, parameters):
|