I am working in SVG tags using javascript. I tried to get group tag
midpoint in svg. Is it possible to get mid point value of group tag using javascr
If you want to get absolute middle point/position of g
tag in screen:
let el = document.getElementById("object_7")
let midX = (el.getBoundingClientRect().left + el.getBoundingClientRect().right) / 2
let midY = (el.getBoundingClientRect().top + el.getBoundingClientRect().bottom) / 2
It also works for other svg elements.