Re: [whatwg] CanvasRenderingContext2D with addPath, currentPath

Under the described circumstances, I agree that we should ha a getter and setter for Path on CanvasRenderingContext2D.

Greetings,
Dirk

On Nov 5, 2013, at 4:29 AM, Rik Cabanier <cabanier@gmail.com> wrote:

> On Mon, Nov 4, 2013 at 5:21 PM, Robert O'Callahan <robert@ocallahan.org>wrote:
> 
>> If you return a path in user-space, what do you get if you call
>> getCurrentPath with a singular transform?
>>  ctx.moveTo(0,0);
>>  ctx.lineTo(1,1);
>>  ctx.scale(0,0);
>>  var p = ctx.getCurrentPath();
>> 
> 
> I mixed up my terms :-)
> getCurrentPath should return the path in device coordinates (not user).
> 
> However, for your example, I'm unsure what the right solution is. The
> canvas specification is silent on what the behavior is for non-invertible
> matrices.
> I think setting scale(0,0) or another matrix operation that is not
> reversible, should remove drawing operations from the state because:
> - how would you stroke with such a matrix?
> - how do patterns operate? the same for gradient fills.
> - how would you pass this to the underlying graphics library?
> - certain operators such as 'arc' rely on doing the transform in reverse.
> 
> I seem to remember that for SVG we decided that non-invertible matrices
> don't draw either.

Received on Thursday, 7 November 2013 07:37:32 UTC