Skip to content

Commit

Permalink
- Reverted some chances related to potential initial bug fix for DotA…
Browse files Browse the repository at this point in the history
…nnotations

- Upgrade to version 1.7.4
- Slightly enlarged default selection area for dot annotations
  • Loading branch information
GeertLitjens committed Feb 7, 2018
1 parent 265fafc commit 625eae2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
34 changes: 15 additions & 19 deletions ASAP/annotation/AnnotationWorkstationExtensionPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,25 +793,21 @@ void AnnotationWorkstationExtensionPlugin::deleteAnnotation(QtAnnotation* annota
QTreeWidgetItemIterator it(_treeWidget);
while (*it) {
if (annotation == (*it)->data(1, Qt::UserRole).value<QtAnnotation*>()) {
if (_annotationService) {
std::vector<std::shared_ptr<Annotation> > annots = _annotationService->getList()->getAnnotations();
int annotInd = std::find(annots.begin(), annots.end(), annotation->getAnnotation()) - annots.begin();
_annotationService->getList()->removeAnnotation(annotInd);
}

_annotToItem.remove(annotation);
_qtAnnotations.removeOne(annotation);
_selectedAnnotations.remove(annotation);
(*it)->setSelected(false);
delete (*it);

// Interacts with the deleteLater, causing a race condition.
/*if (_viewer) {
_viewer->scene()->removeItem(annotation);
}*/
annotation->deleteLater();

break;
if (_viewer) {
_viewer->scene()->removeItem(annotation);
}
if (_annotationService) {
std::vector<std::shared_ptr<Annotation> > annots = _annotationService->getList()->getAnnotations();
int annotInd = std::find(annots.begin(), annots.end(), annotation->getAnnotation()) - annots.begin();
_annotationService->getList()->removeAnnotation(annotInd);
}
annotation->deleteLater();
_annotToItem.remove(annotation);
_qtAnnotations.removeOne(annotation);
_selectedAnnotations.remove(annotation);
(*it)->setSelected(false);
delete (*it);
break;
}
++it;
}
Expand Down
7 changes: 1 addition & 6 deletions ASAP/annotation/DotQtAnnotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ QRectF DotQtAnnotation::boundingRect() const {

QPainterPath DotQtAnnotation::shape() const {
QPainterPath path;
if (isSelected()) {
path.addEllipse(QPointF(), 1.5 * _rectSize / _currentLOD, 1.5 * _rectSize / _currentLOD);
}
else {
path.addEllipse(QPointF(), _rectSize / _currentLOD, _rectSize / _currentLOD);
}
path.addEllipse(QPointF(), 1.5 * _rectSize / _currentLOD, 1.5 * _rectSize / _currentLOD);
return path;
}

Expand Down
1 change: 1 addition & 0 deletions ASAP/annotation/QtAnnotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ _lastClickedSecondCoordinateIndex(-1)
}

QtAnnotation::~QtAnnotation() {
_annotation = NULL;
}

std::shared_ptr<Annotation> QtAnnotation::getAnnotation() const {
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PROJECT(DIAGPathology)

SET(CURRENT_MAJOR_VERSION 1)
SET(CURRENT_MINOR_VERSION 7)
SET(CURRENT_PATCH_VERSION 3)
SET(CURRENT_PATCH_VERSION 4)
set(ASAP_VERSION ${CURRENT_MAJOR_VERSION}.${CURRENT_MINOR_VERSION}.${CURRENT_PATCH_VERSION})

include (GenerateExportHeader)
Expand Down

0 comments on commit 625eae2

Please sign in to comment.