Skip to content

Commit

Permalink
Update quantif in group, not layer, fixes #1820
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Dec 4, 2024
1 parent 0a21bba commit 131e84d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/gui/drawLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,6 @@ export class DrawLayer {
* @param {Annotation} annotation The annotation to update.
*/
#updateAnnotationDraw(annotation) {
// update quantification after math shape update
annotation.updateQuantification();
// update draw if needed
if (this.#removeAnnotationDraw(annotation)) {
this.#addAnnotationDraw(annotation, true);
}
Expand Down
6 changes: 6 additions & 0 deletions src/image/annotationGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ export class AnnotationGroup {
update(annotation, propKeys) {
const index = this.#list.findIndex((item) => item.id === annotation.id);
if (index !== -1) {
// update quantification if needed
if (propKeys.includes('mathShape') ||
propKeys.includes('textExpr')) {
annotation.updateQuantification();
}
// update list
this.#list[index] = annotation;
/**
* Annotation update event.
Expand Down

0 comments on commit 131e84d

Please sign in to comment.