소스 검색

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

gapchich 13 년 전
부모
커밋
2e23610b83
2개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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 */