2

I've setup a drawing utility with Raphael.js. The user can draw shapes, paths and enter text. Once a user adds text -> Paper.text() to the svg the svg goes into a selectable state. Meaning, if I add text and switch to the pen tool, moving the pen around the svg will cause adjacent dom elements to go into their ::selection state.

So I'd like to convert the text to a path to prevent this from happening. I don't see anything like this in the documentation.

JLeonard
  • 8,520
  • 7
  • 36
  • 36

2 Answers2

4

if you use print() instead of text() for text printing, then the text will be a raphael path object. (print() use a cufon javascript font that renders to a raphael path).

cancerbero
  • 6,799
  • 1
  • 32
  • 24
1

Try tweaking the pointer-events property on the text elements with .attr(). none might fit your needs. There are some good background info links on MDN.

.attr({pointer-events: none})
Karlin Fox
  • 191
  • 1
  • 6