From 34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 14 May 2024 11:40:58 -0400 Subject: Double buffered painting looks better --- src/area_popup.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/area_popup.cpp') diff --git a/src/area_popup.cpp b/src/area_popup.cpp index 3b5d8d4..6e70315 100644 --- a/src/area_popup.cpp +++ b/src/area_popup.cpp @@ -1,5 +1,7 @@ #include "area_popup.h" +#include + #include "ap_state.h" #include "game_data.h" #include "global.h" @@ -8,6 +10,8 @@ AreaPopup::AreaPopup(wxWindow* parent, int area_id) : wxScrolledCanvas(parent, wxID_ANY), area_id_(area_id) { + SetBackgroundStyle(wxBG_STYLE_PAINT); + unchecked_eye_ = wxBitmap(wxImage(GetAbsolutePath("assets/unchecked.png").c_str(), wxBITMAP_TYPE_PNG) @@ -108,7 +112,7 @@ void AreaPopup::UpdateIndicators() { } void AreaPopup::OnPaint(wxPaintEvent& event) { - wxPaintDC dc(this); + wxBufferedPaintDC dc(this); PrepareDC(dc); dc.DrawBitmap(rendered_, 0, 0); -- cgit 1.4.1