about summary refs log tree commit diff stats
path: root/src/area_popup.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 11:40:58 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 11:40:58 -0400
commit34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13 (patch)
tree159acd53a925cb8d3e3d44f189b6827f4b27385d /src/area_popup.cpp
parent2bab4f7ae28d0d0b836f00e073816bc920e62d55 (diff)
downloadlingo-ap-tracker-34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13.tar.gz
lingo-ap-tracker-34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13.tar.bz2
lingo-ap-tracker-34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13.zip
Double buffered painting looks better
Diffstat (limited to 'src/area_popup.cpp')
-rw-r--r--src/area_popup.cpp6
1 files changed, 5 insertions, 1 deletions
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 @@
1#include "area_popup.h" 1#include "area_popup.h"
2 2
3#include <wx/dcbuffer.h>
4
3#include "ap_state.h" 5#include "ap_state.h"
4#include "game_data.h" 6#include "game_data.h"
5#include "global.h" 7#include "global.h"
@@ -8,6 +10,8 @@
8 10
9AreaPopup::AreaPopup(wxWindow* parent, int area_id) 11AreaPopup::AreaPopup(wxWindow* parent, int area_id)
10 : wxScrolledCanvas(parent, wxID_ANY), area_id_(area_id) { 12 : wxScrolledCanvas(parent, wxID_ANY), area_id_(area_id) {
13 SetBackgroundStyle(wxBG_STYLE_PAINT);
14
11 unchecked_eye_ = 15 unchecked_eye_ =
12 wxBitmap(wxImage(GetAbsolutePath("assets/unchecked.png").c_str(), 16 wxBitmap(wxImage(GetAbsolutePath("assets/unchecked.png").c_str(),
13 wxBITMAP_TYPE_PNG) 17 wxBITMAP_TYPE_PNG)
@@ -108,7 +112,7 @@ void AreaPopup::UpdateIndicators() {
108} 112}
109 113
110void AreaPopup::OnPaint(wxPaintEvent& event) { 114void AreaPopup::OnPaint(wxPaintEvent& event) {
111 wxPaintDC dc(this); 115 wxBufferedPaintDC dc(this);
112 PrepareDC(dc); 116 PrepareDC(dc);
113 dc.DrawBitmap(rendered_, 0, 0); 117 dc.DrawBitmap(rendered_, 0, 0);
114 118