Summary: | SVG needs ability to calculate path lengths | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> | ||||||
Component: | SVG | Assignee: | Eric Seidel (no email) <eric> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | zimmermann | ||||||
Priority: | P2 | ||||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 11975 | ||||||||
Attachments: |
|
Description
Eric Seidel (no email)
2006-12-29 20:58:39 PST
Created attachment 12116 [details]
first (incomplete) stab
What can I say? I felt inspired.
It's kinda amusing how the 100+ lines of mozilla code which I used to start this, *completely* morphed and turned into about 20 lines of WebKit code.
This is still not done. This only supports calculating path lengths from Path objects, not yet from SVGPathSegList objects, but that second part won't be hard to add.
When adding the SVGPathSegList code, we'll also add the ability to walk a path and find the segment at a specific length.
The only tricky part about adding the SVGPathSegList support is handling SVG Arc segments. There is additional mozilla code we can use to convert from Arcs to curves however.
Created attachment 12136 [details]
Working patch
I decided to chuck the little remaining mozilla code and re-wrote it. We use a similar text length algorithm, but (IMO) a much nicer implementation thereof.
*** Bug 11975 has been marked as a duplicate of this bug. *** |