about summary refs log tree commit diff stats
path: root/src/subway_map.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-18 20:33:16 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-18 20:33:16 -0400
commitc87281384f716c8ca2f57bb8ea65d6d01bb06fae (patch)
treeceb0fe8482c4822f7d8cf2554166afec812f6b7e /src/subway_map.h
parent4e95da4dbb105042bbaf41b7384c73506c86a61e (diff)
downloadlingo-ap-tracker-c87281384f716c8ca2f57bb8ea65d6d01bb06fae.tar.gz
lingo-ap-tracker-c87281384f716c8ca2f57bb8ea65d6d01bb06fae.tar.bz2
lingo-ap-tracker-c87281384f716c8ca2f57bb8ea65d6d01bb06fae.zip
Zoom in and scroll subway map
Diffstat (limited to 'src/subway_map.h')
-rw-r--r--src/subway_map.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/subway_map.h b/src/subway_map.h index 0d26d0b..9b0b43f 100644 --- a/src/subway_map.h +++ b/src/subway_map.h
@@ -29,12 +29,19 @@ class SubwayMap : public wxPanel {
29 private: 29 private:
30 void OnPaint(wxPaintEvent &event); 30 void OnPaint(wxPaintEvent &event);
31 void OnMouseMove(wxMouseEvent &event); 31 void OnMouseMove(wxMouseEvent &event);
32 void OnMouseScroll(wxMouseEvent &event);
33 void OnMouseLeave(wxMouseEvent &event);
34 void OnTimer(wxTimerEvent &event);
32 35
33 void Redraw(); 36 void Redraw();
34 37
35 wxPoint MapPosToRenderPos(wxPoint pos) const; 38 wxPoint MapPosToRenderPos(wxPoint pos) const;
39 wxPoint MapPosToVirtualPos(wxPoint pos) const;
36 wxPoint RenderPosToMapPos(wxPoint pos) const; 40 wxPoint RenderPosToMapPos(wxPoint pos) const;
37 41
42 void SetZoomPos(wxPoint pos);
43 void SetScrollSpeed(int scroll_x, int scroll_y);
44
38 wxImage map_image_; 45 wxImage map_image_;
39 wxImage owl_image_; 46 wxImage owl_image_;
40 wxBitmap unchecked_eye_; 47 wxBitmap unchecked_eye_;
@@ -46,6 +53,14 @@ class SubwayMap : public wxPanel {
46 int render_width_ = 0; 53 int render_width_ = 0;
47 int render_height_ = 0; 54 int render_height_ = 0;
48 55
56 double zoom_ = 1.0;
57 int zoom_x_ = 0; // in render space
58 int zoom_y_ = 0;
59
60 wxTimer* scroll_timer_;
61 int scroll_x_ = 0;
62 int scroll_y_ = 0;
63
49 struct GetItemBox { 64 struct GetItemBox {
50 quadtree::Box<float> operator()(const int &id) const; 65 quadtree::Box<float> operator()(const int &id) const;
51 }; 66 };