From: Eduardo DAVILA Date: Thu, 26 May 2022 04:23:05 +0000 (+0200) Subject: #3485 ShowNPionts for Multiple Groups X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=2a7bf8992b774124851983a7bda4fd41a3f66f14;p=creaMaracasVisu.git #3485 ShowNPionts for Multiple Groups --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index 8b17078..f97d8cd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -793,11 +793,15 @@ void WidgetShowNPoints::OnInsertCollectionAfter(wxCommandEvent &event) //------------------------------------------------------------------------ void WidgetShowNPoints::OnDeleteCollection(wxCommandEvent &event) { - if ( lstModelShowNPoints.size()>=1 ) + if ( lstModelShowNPoints.size()>1 ) { DeleteAllPoints(); // Actual Collection lstModelShowNPoints.erase( lstModelShowNPoints.begin()+mActualCollection ); - mActualCollection--; + lstViewShowNPoints.erase( lstViewShowNPoints.begin()+mActualCollection ); + if ( mActualCollection>=lstModelShowNPoints.size() ) + { + mActualCollection--; + } // if } RefreshCollectionText(); }