diff options
-rw-r--r-- | src/area_popup.h | 3 | ||||
-rw-r--r-- | src/tracker_panel.cpp | 12 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/area_popup.h b/src/area_popup.h index 50e10e8..f8a2355 100644 --- a/src/area_popup.h +++ b/src/area_popup.h | |||
@@ -16,6 +16,9 @@ class AreaPopup : public wxScrolledCanvas { | |||
16 | void ResetIndicators(); | 16 | void ResetIndicators(); |
17 | void UpdateIndicators(); | 17 | void UpdateIndicators(); |
18 | 18 | ||
19 | int GetFullWidth() const { return full_width_; } | ||
20 | int GetFullHeight() const { return full_height_; } | ||
21 | |||
19 | private: | 22 | private: |
20 | enum IndicatorType { | 23 | enum IndicatorType { |
21 | kLOCATION, | 24 | kLOCATION, |
diff --git a/src/tracker_panel.cpp b/src/tracker_panel.cpp index 37e3265..9adcb1f 100644 --- a/src/tracker_panel.cpp +++ b/src/tracker_panel.cpp | |||
@@ -179,7 +179,7 @@ void TrackerPanel::OnRefreshSavedata(wxCommandEvent &event) { | |||
179 | } | 179 | } |
180 | 180 | ||
181 | void TrackerPanel::Resize() { | 181 | void TrackerPanel::Resize() { |
182 | wxSize panel_size = GetSize(); | 182 | wxSize panel_size = GetClientSize(); |
183 | wxSize image_size = map_image_.GetSize(); | 183 | wxSize image_size = map_image_.GetSize(); |
184 | 184 | ||
185 | int final_x = 0; | 185 | int final_x = 0; |
@@ -234,9 +234,13 @@ void TrackerPanel::Resize() { | |||
234 | final_y + map_area.map_y * final_width / image_size.GetWidth(); | 234 | final_y + map_area.map_y * final_width / image_size.GetWidth(); |
235 | 235 | ||
236 | area.popup->SetClientSize( | 236 | area.popup->SetClientSize( |
237 | area.popup->GetVirtualSize().GetWidth(), | 237 | area.popup->GetFullWidth(), |
238 | std::min(panel_size.GetHeight(), | 238 | std::min(panel_size.GetHeight(), area.popup->GetFullHeight())); |
239 | area.popup->GetVirtualSize().GetHeight())); | 239 | |
240 | if (area.popup->GetSize().GetHeight() > panel_size.GetHeight()) { | ||
241 | area.popup->SetSize(area.popup->GetSize().GetWidth(), | ||
242 | panel_size.GetHeight()); | ||
243 | } | ||
240 | 244 | ||
241 | if (popup_x + area.popup->GetSize().GetWidth() > panel_size.GetWidth()) { | 245 | if (popup_x + area.popup->GetSize().GetWidth() > panel_size.GetWidth()) { |
242 | popup_x = panel_size.GetWidth() - area.popup->GetSize().GetWidth(); | 246 | popup_x = panel_size.GetWidth() - area.popup->GetSize().GetWidth(); |