From b527a8a9916cf05afb3adbca7281e40a45db5cf6 Mon Sep 17 00:00:00 2001 From: "Helmut (Oertel) Hoffer von Ankershoffen" Date: Sun, 10 Nov 2024 14:10:31 +0100 Subject: [PATCH] perf(bulkAnnotations): cache affine --- src/bulkAnnotations/utils.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bulkAnnotations/utils.js b/src/bulkAnnotations/utils.js index 41824e4..32c66c8 100644 --- a/src/bulkAnnotations/utils.js +++ b/src/bulkAnnotations/utils.js @@ -468,6 +468,12 @@ export const getFeaturesFromBulkAnnotations = ({ const { topLeft, bottomRight } = getViewportBoundingBox({ view, pyramid, affine }) + const affine = getAffineBasedOnPyramidLevel({ + affine, + pyramid, + annotationGroup + }) + const features = [] for ( @@ -492,11 +498,7 @@ export const getFeaturesFromBulkAnnotations = ({ if (annotationCoordinateType === '2D') { firstCoordinate = mapPixelCoordToSlideCoord({ point: [firstCoordinate[0], firstCoordinate[1]], - affine: getAffineBasedOnPyramidLevel({ - affine, - pyramid, - annotationGroup - }) + affine: affine }) }