Skip to content

Commit

Permalink
Merge pull request #157 from NREL/SAM_1354
Browse files Browse the repository at this point in the history
Addresses SAM issue 1354
  • Loading branch information
sjanzou authored Feb 19, 2023
2 parents 7476aac + 45d904e commit 729e5f5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/diurnal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void wxDiurnalPeriodCtrl::OnPaint(wxPaintEvent &) {

int val = VALUE(r, c);
if ((val >= 0 && val - 1 < (int) m_colours.size()) || sel) {
if (IsThisEnabled())
if (IsThisEnabled() && val < (int)m_colours.size())
dc.SetBrush(wxBrush(sel ? wxColour(0, 114, 198) : m_colours[val]));
else
dc.SetBrush(wxBrush(*wxLIGHT_GREY));
Expand Down Expand Up @@ -635,6 +635,18 @@ void wxDiurnalPeriodCtrl::SetupTOUGrid() {
AddColour(wxColour(86, 172, 214)); // 10
AddColour(wxColour(254, 235, 97)); // 11
AddColour(wxColour(91, 83, 252)); // 12
AddColour(wxColour(19, 148, 49)); // 13
AddColour(wxColour(144, 175, 133)); // 14
AddColour(wxColour(19, 219, 112)); // 15
AddColour(wxColour(106, 57, 57)); // 16
AddColour(wxColour(4, 136, 81)); // 17
AddColour(wxColour(25, 136, 225)); // 18
AddColour(wxColour(55, 60, 157)); // 19
AddColour(wxColour(186, 172, 214)); // 20
AddColour(wxColour(54, 235, 97)); // 21
AddColour(wxColour(191, 83, 252)); // 22
AddColour(wxColour(54, 235, 97)); // 23
AddColour(wxColour(191, 83, 252)); // 24

m_rowLabels.clear();
AddRowLabel("Jan");
Expand Down

0 comments on commit 729e5f5

Please sign in to comment.