]> Creatis software - creaMaracasVisu.git/commitdiff
#3485 ShowNPionts for Multiple Groups
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 26 May 2022 04:23:05 +0000 (06:23 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 26 May 2022 04:23:05 +0000 (06:23 +0200)
lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx

index 8b17078b3213ccb4a202770fcd0da589a5cce2ad..f97d8cd6fb1221642cd2ef60cb2824fd8b634066 100644 (file)
@@ -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();
 }