Re: hit testing and retained graphics

Charles Pritchard:
> > > They in no way "step on" the propriety of SVG -- they in fact
> > > enhance interoperability,

Cameron McCormack:
> > (Not sure how they enhance interoperability if nobody implements
> > them yet…)

Charles Pritchard:
> Some vendors do implement normalized strings.

Sorry, I thought you meant enhance interoperability of your proposal.

> I've personally implemented SVG, and I've worked with other
> developer's implementations of SVG which worked atop canvas. I've also
> worked with issues where method calls had unfortunate overhead. In all
> cases, it's a big help to have the Canvas implementation recognize
> normalized SVG strings. And it's relatively inexpensive to add to
> Canvas implementations.

(Sorry to belabour this point.)

I should think it would be easy enough for the implementation to support
full SVG strings.  After all, if getCurrentPath returns a normalised
string, and the current path your create on the canvas context included
any arc commands, then your implementation will need to have code to
flatten them down to Béziers or straight line segments.  On the other
hand, if you perform no normalisation, the mapping from the path as
built up using lineTo/arcTo/etc. to the path data string that you return
is simple.

> > I think the whole point of SVG exposing path data as either
> > normalised or un-normalised is that user script may find it easier
> > not to have to deal with both relative and absolute commands, arcs,
> > etc.
>
> And the implementation. It's a lot of extra work, and it's not really
> necessary, as it can be handled at other points in the pipeline.

This is only the case if you somehow disallow authors from calling
arcTo.  Authors can construct paths with canvas now that include arc
commands.  If you want to return normalised path data, the
implementation needs to do work to flatten this.  If you return
unnormalised path data, you don’t have to do any work.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Friday, 24 June 2011 03:18:54 UTC