Skip to content

Commit

Permalink
fix(PlanarFreehandROITool): recalculate stats upon edit (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
m00n620 committed Jun 14, 2023
1 parent e1d087a commit f193701
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ function completeClosedContourEdit(element: HTMLDivElement) {
annotation.data.polyline = worldPoints;
annotation.data.isOpenContour = false;

annotation.invalidated = true;

this.triggerAnnotationModified(annotation, enabledElement);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@ function completeDrawClosedContour(element: HTMLDivElement): boolean {

annotation.data.polyline = worldPoints;
annotation.data.isOpenContour = false;
const { textBox } = annotation.data.handles;

this.triggerAnnotationCompleted(annotation);
if (!textBox.hasMoved) {
this.triggerAnnotationCompleted(annotation);
}

this.isDrawing = false;
this.drawData = undefined;
Expand Down Expand Up @@ -296,6 +299,7 @@ function completeDrawOpenContour(element: HTMLDivElement): boolean {

annotation.data.polyline = worldPoints;
annotation.data.isOpenContour = true;
const { textBox } = annotation.data.handles;

// Add the first and last points to the list of handles. These means they
// will render handles on mouse hover.
Expand All @@ -310,7 +314,9 @@ function completeDrawOpenContour(element: HTMLDivElement): boolean {
findOpenUShapedContourVectorToPeak(canvasPoints, viewport);
}

this.triggerAnnotationCompleted(annotation);
if (!textBox.hasMoved) {
this.triggerAnnotationCompleted(annotation);
}

this.isDrawing = false;
this.drawData = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ function completeOpenContourEdit(element: HTMLDivElement) {
findOpenUShapedContourVectorToPeak(fusedCanvasPoints, viewport);
}

annotation.invalidated = true;

this.triggerAnnotationModified(annotation, enabledElement);
}

Expand Down

0 comments on commit f193701

Please sign in to comment.