aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel/editor
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-12-28 10:37:57 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-12-28 10:37:57 +0100
commit2151ccbe650132c8d07fba3c70c63ddc768dd38f (patch)
tree24f35f19e0936dd1515233514b1d9e78654eade5 /src/game_tab/right_panel/editor
parent35d9a6f0d9197efb91ee7453cb93602f06f4dc0a (diff)
Improve drawing
Diffstat (limited to 'src/game_tab/right_panel/editor')
-rw-r--r--src/game_tab/right_panel/editor/EditorCanvas.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp
index 0e2f77a..870dd26 100644
--- a/src/game_tab/right_panel/editor/EditorCanvas.cpp
+++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp
@@ -37,6 +37,7 @@ wxPoint EditorCanvas::Middle(cgeditor::Element e) {
}
void EditorCanvas::DrawElement(const cgeditor::Element &e) {
+ // TODO: Optimize brush!!!! Always instanciated at each call
dc->SetPen(wxNullPen);
dc->SetBrush(*wxRED_BRUSH);
if (e.prop & cgeditor::Property::Rectangle) {
@@ -45,7 +46,7 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) {
} else if (e.prop & cgeditor::Property::Scrollbar) {
dc->SetBrush(*wxGREY_BRUSH);
} else if (e.prop & cgeditor::Property::Margin) {
- dc->SetBrush(*wxLIGHT_GREY_BRUSH);
+ dc->SetBrush(wxBrush(wxColour(243,243,243)));
} else if (e.prop & cgeditor::Property::Button) {
if (e.prop & cgeditor::Property::On) {
dc->DrawBitmap(hide_icon, e.x, e.y);
@@ -77,25 +78,25 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) {
}
if (e.prop & cgeditor::Property::Current) {
wxRect recToDraw(e.x, e.y, e.width, e.height);
- dc->SetBrush(*wxLIGHT_GREY_BRUSH);
+ dc->SetBrush(wxBrush(wxColour(216, 216, 216)));
dc->DrawRectangle(recToDraw);
}
dc->DrawBitmap(*t.Get(p), e.x, y);
} else if (e.prop & cgeditor::Property::Comment) {
wxRect recToDraw(e.x, e.y, e.width, e.height);
- dc->SetBrush(*wxYELLOW_BRUSH);
+ dc->SetBrush(wxBrush(wxColour(255, 255, 204)));
dc->DrawRectangle(recToDraw);
dc->DrawText(wxString(e.text), wxPoint(e.x, e.y));
} else if (e.prop & cgeditor::Property::Menuitem) {
wxRect recToDraw(e.x, e.y, e.width, e.height);
- dc->SetBrush(*wxLIGHT_GREY_BRUSH);
+ dc->SetBrush(wxBrush(wxColour(216, 216, 216)));
dc->DrawRectangle(recToDraw);
dc->DrawText(wxString(e.text), wxPoint(e.x, Middle(e).y));
} else {
if (e.prop & cgeditor::Property::Move) {
if (e.prop & cgeditor::Property::Current) {
wxRect recToDraw(e.x, e.y, e.width, e.height);
- dc->SetBrush(*wxLIGHT_GREY_BRUSH);
+ dc->SetBrush(wxBrush(wxColour(216, 216, 216)));
dc->DrawRectangle(recToDraw);
}
if (CGEditor::status.UseMoveIcons) {