Skip to content

Commit 5822b2f

Browse files
author
hoang.tran12
committed
fix hover position
1 parent 28dc054 commit 5822b2f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/magnify_image.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ export default {
136136
}
137137

138138
let rect = UfsGlobal.DOM.getContentClientRect(e.target);
139+
if (rect.width < 30 || rect.height < 30) {
140+
rect.top -= rect.width / 2;
141+
rect.left -= rect.height / 2;
142+
}
139143
rect.left = Math.max(rect.left, 0);
140144
rect.top = Math.max(rect.top, 0);
141145

0 commit comments

Comments
 (0)