Re: Replace getPathSegmentAtLength with getPathSegmentIndexAtLength
Jarek Foksa <[email protected]>
| Newsgroups | gmane.comp.web.svg |
|---|---|
| Message-ID | <[email protected]> |
I’m sorry, I meant "M 0 0 h 10 h 10 h 10 h 10 h 10” not "M 0 0 H 10 H 10 H 10 H 10 H 10”. > On 2015-11-07, at 14:08, Jarek Foksa <[email protected]> wrote: > > Given a path with data "M 0 0 H 10 H 10 H 10 H 10 H 10", path.getPathSegmentAtLength(25) will return {type: "H”, values: [10]} which could represent any of the five H segments. Since the returned object is non-live, you can’t determine its index by comparing it to pathData items. > > This ambiguity could be eliminated if the method was returning segment index instead of segment object.