From 2151ccbe650132c8d07fba3c70c63ddc768dd38f Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 28 Dec 2022 10:37:57 +0100 Subject: Improve drawing --- src/game_tab/right_panel/editor/EditorCanvas.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/game_tab/right_panel/editor/EditorCanvas.cpp') 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) { -- cgit v1.2.3