Skip to content

Commit

Permalink
fix: wrong ushape calculation when loading SR/freehand from server (#199
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ladeirarodolfo authored Sep 5, 2022
1 parent 7ae8f89 commit ce0c5c9
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ function renderContour(
svgDrawingHelper: SVGDrawingHelper,
annotation: PlanarFreehandROIAnnotation
): void {
// prevent drawing or further calculation in case viewport data is not ready yet
if (!enabledElement?.viewport?.getImageData()) {
return;
}
// Check if the contour is an open contour
if (annotation.data.isOpenContour) {
// If its an open contour, check i its a U-shaped contour
Expand Down Expand Up @@ -212,6 +216,11 @@ function renderOpenUShapedContour(

this.renderOpenContour(enabledElement, svgDrawingHelper, annotation);

// prevent rendering u shape in case openUShapeContourVectorToPeak is not set yet
if (!openUShapeContourVectorToPeak) {
return;
}

const firstCanvasPoint = viewport.worldToCanvas(polyline[0]);
const lastCanvasPoint = viewport.worldToCanvas(polyline[polyline.length - 1]);

Expand Down

0 comments on commit ce0c5c9

Please sign in to comment.