F
F
FLighter2019-12-21 15:15:17
JavaScript
FLighter, 2019-12-21 15:15:17

How to fix "jump" element on onMouseDown?

There is a simple task: drag the svg group of elements with the correct initial cursor position. But I ran into the following problem: at different radii of the circle on onMouseDown, a jump occurs on any element. If the radii are equal everywhere, then everything works as it should. I can't figure out what value I'm missing when calculating the cursor offset, because the size of the group should increase with the elements inside.
Here is the code to make it clear what we are talking about: https://codepen.io/FLighter/pen/PowpjYB
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RAX7, 2019-12-21
@flighter7

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question