Fixed Scaling bug.
The drawing area 2 times as big as it should be
I halved the size of everything it draws.
I also doubled the x and y values of the points it takes in in order to
make where you click and where it thinks you clicked to match up.
Change-Id: I62bf567175dce4e5990f31561558bcce1ed68397
diff --git a/frc971/control_loops/python/path_edit.py b/frc971/control_loops/python/path_edit.py
index 3a0a323..9edbb47 100644
--- a/frc971/control_loops/python/path_edit.py
+++ b/frc971/control_loops/python/path_edit.py
@@ -236,6 +236,8 @@
# Fill the background color of the window with grey
set_color(cr, palette["GREY"])
cr.paint()
+ #Scale the field to fit within drawing area
+ cr.scale(0.5,0.5)
# Draw a extents rectangle
set_color(cr, palette["WHITE"])
@@ -537,8 +539,9 @@
def do_button_press(self, event):
print("button press activated")
- self.x = event.x
- self.y = event.y
+ #Be consistent with the scaling in the drawing_area
+ self.x = event.x * 2
+ self.y = event.y * 2
self.button_press_action()