Kaynağa Gözat

- area deleting now works
- areas without color won't cause crash

gapchich 13 yıl önce
ebeveyn
işleme
2e23610b83
2 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 4 1
      ImageHolder.cpp
  2. 1 1
      functions.cpp

+ 4 - 1
ImageHolder.cpp

@@ -92,7 +92,10 @@ ImageHolder::drawBoundingBoxes(
 	for (int i = 0; i < list_bounding_box_->size(); i++) {
 		int labelID = list_bounding_box_->at(i).label_ID_;
 
-		aPen->setColor(QColor(list_label_color_->at(labelID)));
+		if (labelID < list_label_color_->count())
+			aPen->setColor(QColor(list_label_color_->at(labelID)));
+		else
+			aPen->setColor(QColor(Qt::white));
 
 		/* checking whether labeled area is of main object or not */
 		if (labelID == *main_label_)

+ 1 - 1
functions.cpp

@@ -24,7 +24,7 @@ getNumFromString(
 {
 	int numPos = aString->indexOf(aFirstStr) + aFirstStr.size();
 
-	if (-1 <= numPos) {
+	if (numPos < 0) {
 		*anOkFlag = 0;
 		return -1;
 		/* NOTREACHED */