1

After looking at the documentation of raphael.js, I was only able to find the Paper.clear() and Element.attr({'clip-rect':...}) methods for "erasing" the paper. The former erases the entire paper and the latter clips parts of existing elements.

Is it possible to erase a "path" within the paper, mimicking an actual erase tool?

Or is there a better library better suited for implementing a simple MS Paint/Photoshop clone?

TheOne
  • 10,819
  • 20
  • 81
  • 119
  • You can always remove a given element by calling `element.remove` -- but, when you suggest "mimicking an actual erase tool," it sounds as though you're looking for an animation. Can you provide an example of what you're looking for? – Kevin Nielsen Dec 14 '12 at 22:29
  • @KevinNielsen, say there are a bunch of shapes and paths on the paper, how would I erase a path? You know...a regular physical pencil eraser. – TheOne Dec 16 '12 at 01:50
  • 1
    If you want pixel-level control then use canvas instead of svg. – Erik Dahlström Dec 16 '12 at 12:56
  • I haven't used a physical pencil for many years, to be honest -- I forgot how they worked ;-) @ErikDahlström is right -- if you want to simulate the process of erasing a shape, you'd need to use canvas (or apply a clever overlay to your svg, but I doubt that would be worthwhile) – Kevin Nielsen Dec 16 '12 at 19:32
  • got it thanks! @ErikDahlström's comment should be the answer. – TheOne Dec 17 '12 at 13:23

0 Answers0