Skip to content

Commit dcdce26

Browse files
committed
Merge branch 'fix/bounding-box-position' into 'develop'
Fix/bounding box position See merge request genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator!273
2 parents 4f68446 + 02fe181 commit dcdce26

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/ui/src/components/document-viewer/VisualEditorModal.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ const BoundingBox = memo(({ box, page, currentPage, imageRef, zoomLevel = 1, pan
9797
transformedOffsetY,
9898
});
9999
};
100-
101-
// Small delay to allow transforms to complete
102-
const timeoutId = setTimeout(updateDimensions, 50);
103-
104-
return () => clearTimeout(timeoutId);
100+
// Delay to allow transforms to complete
101+
const timeoutId = setTimeout(updateDimensions, 150);
102+
// Ensure accuracy after reset
103+
const secondTimeoutId = setTimeout(updateDimensions, 300);
104+
return () => {
105+
clearTimeout(timeoutId);
106+
clearTimeout(secondTimeoutId);}
105107
}
106108
return undefined;
107109
}, [zoomLevel, panOffset, imageRef, page, currentPage]);

0 commit comments

Comments
 (0)