Skip to content

Commit 2cf1e62

Browse files
helmut-hoffer-von-ankershoffenHelmut (Oertel) Hoffer von Ankershoffen
andauthored
perf(bulkAnnotations): cache affine (#159)
* perf(bulkAnnotations): cache affine * fix: typo --------- Co-authored-by: Helmut (Oertel) Hoffer von Ankershoffen <[email protected]>
1 parent 628555a commit 2cf1e62

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/bulkAnnotations/utils.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,12 @@ export const getFeaturesFromBulkAnnotations = ({
468468

469469
const { topLeft, bottomRight } = getViewportBoundingBox({ view, pyramid, affine })
470470

471+
const cachedAffine = getAffineBasedOnPyramidLevel({
472+
affine,
473+
pyramid,
474+
annotationGroup
475+
})
476+
471477
const features = []
472478

473479
for (
@@ -492,11 +498,7 @@ export const getFeaturesFromBulkAnnotations = ({
492498
if (annotationCoordinateType === '2D') {
493499
firstCoordinate = mapPixelCoordToSlideCoord({
494500
point: [firstCoordinate[0], firstCoordinate[1]],
495-
affine: getAffineBasedOnPyramidLevel({
496-
affine,
497-
pyramid,
498-
annotationGroup
499-
})
501+
affine: cachedAffine
500502
})
501503
}
502504

0 commit comments

Comments
 (0)