I am using Raphaël library to create a quick draw tool. But there is an error with arrow end, they are assigned same for all lines.
Say,I have lineA with an arrowhead of #raphael-marker-oval. Then, I draw lineB and assign an arrowhead of #raphael-marker-oval also. Whenever I change the arrowhead of lineA to a new color, the arrowhead of lineB will be changed to same color also.
Please help!!
I'm having a similar problem, where arrowheads disappear when a containing div is hidden. This seems to be a bug in Raphael: https://github.com/DmitryBaranovskiy/raphael/pull/525 I'm just researching it and trying to figure out how to fix it ...
Looks like the problem is fixed if markerIds are unique. This is what I did to fix it: in raphael.js: Line 28:
var raphaelMarkerIdFixCount = 1;
Line 5938: replace this:
markerId = "raphael-marker-" + se + type + w + h;
with this:
markerId = "raphael-marker-" + se + type + w + h + raphaelMarkerIdFixCount;
raphaelMarkerIdFixCount++;
Since it now means that a new marker element is created every time, it may lead to memory issues if you are drawing a huge number of arrows - someone may be able to come up with a better patch, this fix is certainly in the 'quick-and-dirty' category - but it worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With