0

I am an amateur on coding, trying to learn Javascript. Pardon me if I sound too generic. I'll try my best not to.

I am working on SVG-edit and I am trying to get the length of a subpath(the path that is being drawn after i create a node on my ''superpath'') . I know i can get the total length of the ''superpath'' with the get.totalpathlength method.

Is their a method that does that or do I need to construct a formula from scratch using the totalpathlength and mouseclick detections?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
nicholaswmin
  • 21,686
  • 15
  • 91
  • 167

1 Answers1

1

If you want to know the length of the last segment, measure the whole path then measure an invisible copy of the path without the last segment and subtract.

Robert Longson
  • 118,664
  • 26
  • 252
  • 242