Skip to content

Commit

Permalink
Merge pull request #872 from girder/reduce-updates
Browse files Browse the repository at this point in the history
Reduce updates when modifying annotations.
  • Loading branch information
manthey authored Jun 1, 2022
2 parents d20d7d8 + 88a6223 commit b3ed50e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},

Expand Down

0 comments on commit b3ed50e

Please sign in to comment.