You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/components/ImageCard/ImageHotspots.jsx
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -387,7 +387,13 @@ export const zoom = (
387
387
}
388
388
};
389
389
390
-
constgetAccumulatedOffset=(imageElement)=>{
390
+
/**
391
+
* Since the imageElement is not at the borders of the screen, we need to calculate the X and Y offsets of the Image from the parents
392
+
* @param {*} imageElement
393
+
* @return {object} top, left pixels that indicate where the image is placed on the page
394
+
*/
395
+
exportconstgetAccumulatedOffset=(imageElement)=>{
396
+
// TODO: replace with simpler approach and share as utility function: https://stackoverflow.com/questions/5601659/how-do-you-calculate-the-page-position-of-a-dom-element-when-the-body-can-be-rel
0 commit comments