Raphael.js converts text to a path

I installed the drawing utility using Raphael.js. The user can draw shapes, paths and enter text. When the user adds the text -> Paper.text () to svg, svg goes into the select state. Meaning, if I add text and switch to the pen tool, moving the pen around svg will cause adjacent dom elements to enter their :: select state.

Therefore, I would like to convert the text to a path so that this does not happen. I do not see anything like this in the documentation.

+2
source share
2 answers

if you use print () instead of text () for text printing, then the text will be an object of the raphael path. (print () uses the javascript cufon font, which displays the raphael path).

+4
source

Try .attr() pointer-events property to text elements with .attr() . none can fit your needs. There are some good reference informational links to MDN .

 .attr({pointer-events: none}) 
+1
source

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


All Articles