We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 116b9ab commit 6f6eb85Copy full SHA for 6f6eb85
1 file changed
Tools/Centroid Center Calculator.html
@@ -972,13 +972,18 @@ <h3>No image selected</h3>
972
markerEl.style.top = `${screenY}px`;
973
}
974
975
- window.addEventListener('resize', () => {
+ function repositionMarkers() {
976
if (contentArea.classList.contains('hidden') || !currentImageState.img) return;
977
const { centroid, bboxCenter } = currentImageState;
978
if (!centroid || !bboxCenter) return;
979
positionVisuals(centroidMarker, centroid.x, centroid.y);
980
positionVisuals(bboxMarker, bboxCenter.x, bboxCenter.y);
981
- });
+ }
982
+
983
+ window.addEventListener('resize', repositionMarkers);
984
985
+ const canvasContainer = canvas.parentElement;
986
+ new ResizeObserver(repositionMarkers).observe(canvasContainer);
987
988
</script>
989
</body>
0 commit comments