1

Following the top answer to this stack overflow question I was able to make a draggable and resizable path-based shape using Raphaël.

jsFiddle Resizable Path

The one thing I can't figure out is how to avoid unequal scaling if the path has a stroke to it. As long as the scaling is 1:1, the stroke width stays the same, but stretching the path in one direction or another thins the stroke in one direction. Is there a way to transform a path without affecting the stroke?

Community
  • 1
  • 1
Josan
  • 145
  • 1
  • 6

1 Answers1

0

Not using transformations. You could try modifying the actual path, e.g. "M10,10L20,20" would become "M10,10L40,20" (equivalent of "S2,1").

Also, have a look at Raphael.FreeTransform which handles dragging/rotating/scaling (doesn't address the stroke issue though).

Elbert Alias
  • 1,770
  • 1
  • 16
  • 25
  • Eventually there will be a couple hundred shapes, so I was hoping to avoid manipulating the actual paths. The FreeTransform is great though, thanks for the link. – Josan Dec 07 '11 at 11:50