From c87281384f716c8ca2f57bb8ea65d6d01bb06fae Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 18 May 2024 20:33:16 -0400 Subject: Zoom in and scroll subway map --- src/subway_map.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/subway_map.h') 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 { private: void OnPaint(wxPaintEvent &event); void OnMouseMove(wxMouseEvent &event); + void OnMouseScroll(wxMouseEvent &event); + void OnMouseLeave(wxMouseEvent &event); + void OnTimer(wxTimerEvent &event); void Redraw(); wxPoint MapPosToRenderPos(wxPoint pos) const; + wxPoint MapPosToVirtualPos(wxPoint pos) const; wxPoint RenderPosToMapPos(wxPoint pos) const; + void SetZoomPos(wxPoint pos); + void SetScrollSpeed(int scroll_x, int scroll_y); + wxImage map_image_; wxImage owl_image_; wxBitmap unchecked_eye_; @@ -46,6 +53,14 @@ class SubwayMap : public wxPanel { int render_width_ = 0; int render_height_ = 0; + double zoom_ = 1.0; + int zoom_x_ = 0; // in render space + int zoom_y_ = 0; + + wxTimer* scroll_timer_; + int scroll_x_ = 0; + int scroll_y_ = 0; + struct GetItemBox { quadtree::Box operator()(const int &id) const; }; -- cgit 1.4.1