From ab76afb34070a33a2a8c09426408777580d984e4 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sat, 27 Jun 2020 22:17:26 +0930 Subject: Functionality: moving multiple gates works, smoothed moving single gate --- MainWindow.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'MainWindow.h') diff --git a/MainWindow.h b/MainWindow.h index 1110806..3623a1f 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -95,6 +95,16 @@ class MainWindow : public FXMainWindow MainWindow(){} private: + struct Coord { + int X; + int Y; + + Coord operator-(const Coord& other) const + { + return { X - other.X, Y - other.Y }; + } + }; + void create_ui(); void draw(); void update_gate_state(Gate *gate); @@ -161,6 +171,7 @@ class MainWindow : public FXMainWindow int rubberband_starty; int multiple_move_startx; int multiple_move_starty; + Coord lastPos; /* keyboard */ bool lshift_down = false; -- cgit v1.2.3