Browse Source

Working model drag with connecting lines

Yentl Van Tendeloo 8 years ago
parent
commit
fc8b3c8ccf
2 changed files with 3 additions and 3 deletions
  1. 1 1
      classes/canvas/canvas_element.xml
  2. 2 2
      frontend.py

+ 1 - 1
classes/canvas/canvas_element.xml

@@ -94,7 +94,7 @@
                     delta_x = self.original_coords[0] - self.last_x
                     delta_x = self.original_coords[0] - self.last_x
                     delta_y = self.original_coords[1] - self.last_y
                     delta_y = self.original_coords[1] - self.last_y
 
 
-                    self.coordinates = self.coordinates[0] + delta_x, self.coordinates[1] + delta_y
+                    self.coordinates = self.coordinates[0] - delta_x, self.coordinates[1] - delta_y
                     self.to_update = dict(self.elements)
                     self.to_update = dict(self.elements)
                 </script>
                 </script>
             </transition>
             </transition>

+ 2 - 2
frontend.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Fri Sep 15 10:41:28 2017
+Date:   Fri Sep 15 11:05:03 2017
 
 
 Model author: Yentl Van Tendeloo and Addis Gebremichael
 Model author: Yentl Van Tendeloo and Addis Gebremichael
 Model name:   Modelverse Visual Editor - Tkinter Version 
 Model name:   Modelverse Visual Editor - Tkinter Version 
@@ -5977,7 +5977,7 @@ class CanvasElement(RuntimeClassBase, SCCDWidget):
         delta_x = self.original_coords[0] - self.last_x
         delta_x = self.original_coords[0] - self.last_x
         delta_y = self.original_coords[1] - self.last_y
         delta_y = self.original_coords[1] - self.last_y
         
         
-        self.coordinates = self.coordinates[0] + delta_x, self.coordinates[1] + delta_y
+        self.coordinates = self.coordinates[0] - delta_x, self.coordinates[1] - delta_y
         self.to_update = dict(self.elements)
         self.to_update = dict(self.elements)
     
     
     def _dragging_1_guard(self, parameters):
     def _dragging_1_guard(self, parameters):