diff --git a/girder_annotation/girder_large_image_annotation/models/annotation.py b/girder_annotation/girder_large_image_annotation/models/annotation.py index a33ca09ed..d34db7958 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotation.py +++ b/girder_annotation/girder_large_image_annotation/models/annotation.py @@ -1300,7 +1300,7 @@ def removeOldAnnotations(self, remove=False, minAgeInDays=30, keepInactiveVersio :param keepInactiveVersions: keep at least this many inactive versions of any annotation, regardless of age. """ - if remove and minAgeInDays < 7 or minAgeInDays < 0: + if (remove and minAgeInDays < 7) or minAgeInDays < 0: raise ValidationException('minAgeInDays must be >= 7') age = datetime.datetime.utcnow() + datetime.timedelta(-minAgeInDays) if keepInactiveVersions < 0: diff --git a/girder_annotation/girder_large_image_annotation/web_client/views/imageViewerWidget/geojs.js b/girder_annotation/girder_large_image_annotation/web_client/views/imageViewerWidget/geojs.js index f925662f2..94a24639e 100644 --- a/girder_annotation/girder_large_image_annotation/web_client/views/imageViewerWidget/geojs.js +++ b/girder_annotation/girder_large_image_annotation/web_client/views/imageViewerWidget/geojs.js @@ -504,13 +504,15 @@ var GeojsImageViewerWidgetExtension = function (viewer) { * @param {string?} element The id of the element to highlight */ highlightAnnotation: function (annotation, element) { - this._highlightAnnotation = annotation; - this._highlightElement = element; - _.each(this._annotations, (layer, annotationId) => { - const features = layer.features; - this._mutateFeaturePropertiesForHighlight(annotationId, features); - }); - this.viewer.scheduleAnimationFrame(this.viewer.draw); + if (annotation !== this._highlightAnnotation || element !== this._highlightElement) { + this._highlightAnnotation = annotation; + this._highlightElement = element; + _.each(this._annotations, (layer, annotationId) => { + const features = layer.features; + this._mutateFeaturePropertiesForHighlight(annotationId, features); + }); + this.viewer.scheduleAnimationFrame(this.viewer.draw); + } return this; },