The problem of zooming in svg drawing

use svg to draw a coordinate system and draw some coordinate points, but according to the origin as the scaling point, after scaling according to a certain proportion, the drawn point will be offset from the position of the mouse click, the farther away from the origin, the greater the offset?

May.28,2021

can't do it, so just use a ready-made one, such as https://github.com/ariutta/sv.


need to take into account the actual size of svg (width,height) and the size ratio of the virtual coordinate system (viewBox).

Menu