How to add a point to a path in Raphael (SVG)

I am in a situation where I have several paths on the screen, updated several times per second. they are extremely simple lines, each of which is a simple line on the canvas.

I need an efficient way to update paths. At the moment, I am extracting a path string for each of them, adding "L xx xx" and redrawing. This is good with few lines, but performance is very poor if the frequency (or the number of paths) increases.

So the real question is: does Rafael really provide a method that simply β€œadds a point to the path”? I am very new to vectors, not to mention Raphael and svg.

I would be grateful for any help

Thanks To

+4
source share
1 answer

It’s interesting what you are doing;) Try only the Maintenon updated path and use the β€œpath” attribute on the path. I would be interested to know if the performance will improve. You can also visit my site and play with a demonstration there for wonderful round paths.

http://irunmywebsite.com/raphael/additionalhelp.php?v=2

Check out the Catmull Rom Curves technique that can inspire ... AVOID BIG LINKS AND PLAN YOUR iPod!

-2
source

Source: https://habr.com/ru/post/1400549/


All Articles