From bee0a5103425ad0c1a28bdc1ef57587343f446d0 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Tue, 7 Mar 2017 16:38:22 -0600 Subject: [PATCH] fix issue #639 crash when open custom category in histgram --- Explore/HistogramView.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Explore/HistogramView.cpp b/Explore/HistogramView.cpp index bd3362d85..2f60d6af5 100644 --- a/Explore/HistogramView.cpp +++ b/Explore/HistogramView.cpp @@ -745,6 +745,10 @@ void HistogramCanvas::PopulateCanvas() } selectable_shps.resize(cur_intervals); + if (!is_custom_category) { + cat_classif_def.colors.resize(cur_intervals); + cat_classif_def.names.resize(cur_intervals); + } for (int i=0; isetPen(GdaConst::qualitative_colors[i%sz]); selectable_shps[i]->setBrush(GdaConst::qualitative_colors[i%sz]); + cat_classif_def.colors[i] = GdaConst::qualitative_colors[i%sz]; } else { selectable_shps[i]->setPen(cat_classif_def.colors[i]); selectable_shps[i]->setBrush(cat_classif_def.colors[i]); @@ -890,6 +895,8 @@ void HistogramCanvas::InitIntervals() ival_obs_cnt.resize(boost::extents[ts][cur_intervals]); ival_obs_sel_cnt.resize(boost::extents[ts][cur_intervals]); + cat_classif_def.num_cats = cur_intervals; + for (int t=0; t