Closed GoldWood2000 closed 2 years ago
Hard to tell without seeing any code.
没有看到任何代码很难说。
My need is to show and hide a text at the position of the mouse
Is the tip_text inside some svg or other container or element that may be scaled or translated ?
Is the tip_text inside some svg or other container or element that may be scaled or translated ?
yes, inside an svg,The first red circle part is the position where my mouse is placed on the line, but the obtained x and y are indeed very different from the mouse position. It is expected that a==1 will be displayed in the first red circle.
Ok, so you probably need to either move the text outside of the elements that are transforming it, or transform the x,y with the with the inverse of the transform that's affecting it. It's a bit fiddly that stuff (Snap.svg may be slightly easier Raphaels sister package, but you will likely still have to get a bit messy if you can't draw it outside of the elements affecting it).
Hello, I have a problem, that is, the red circle part on the picture is the position where my mouse is placed, and then the x, y are obtained, and the character a==1 is displayed, but why is the position of x and y not my mouse? The location and the gap is so big, which puzzles me