]> Creatis software - clitk.git/commitdiff
Correct bug when the user cancel the color selection
authorDavid Sarrut <david.sarrut@gmail.com>
Fri, 3 Feb 2012 06:57:12 +0000 (07:57 +0100)
committerDavid Sarrut <david.sarrut@gmail.com>
Fri, 14 Sep 2012 13:19:18 +0000 (15:19 +0200)
vv/vvToolROIManager.cxx

index 645941cb4fd3a8555a980c42db12fb3fba0a7486..e1d2e5c534e2f586d45657d3911a14417d6e6641 100644 (file)
@@ -677,6 +677,8 @@ void vvToolROIManager::ChangeColor() {
                 mCurrentROIActor->GetROI()->GetDisplayColor()[1],
                 mCurrentROIActor->GetROI()->GetDisplayColor()[2]);
   QColor c = QColorDialog::getColor(color, this, "Choose the ROI color");
+  if (!c.isValid()) return;// User cancel
+
   mCurrentROIActor->GetROI()->SetDisplayColor(c.redF(), c.greenF(), c.blueF());
   mCurrentROIActor->UpdateColor();