W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2006

[whatwg] Canvas 2d methods

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 03 Jul 2006 15:01:54 -0700
Message-ID: <004501c69eec$4c165400$3401a8c0@TERRA>

----- Original Message ----- 
From: "L. David Baron" <dbaron@dbaron.org>
To: <whatwg at whatwg.org>
Sent: Monday, July 03, 2006 2:48 PM
Subject: Re: [whatwg] Canvas 2d methods

>>On Sunday 2006-07-02 22:47 +0200, Stefan G?ssner wrote:
>> hmm ...
>>
>> ctx.scale(2,1)
>>   .rotate(Math.PI/4)
>>   .translate(4,-6);
>>
>> illustrates a sequence of manipulations semantically very well, doesn't 
>> it?

>In my opinion, this pattern generally makes sense semantically when used
>on immutable objects (e.g., strings in JavaScript).

>I don't think this pattern makes sense for mutable objects.  It just
>suggests immutability.  And making the canvas context objects immutable
>doesn't really make sense without much more significant changes.

>-David

"this pattern generally makes sense semantically when used on immutable
objects (e.g., strings in JavaScript)."

Why?

For me personally it is close to
context <<  moveTo(..)  <<  lineTo(...) << arcTo(....);

which is perfectly close to what is going on in reality:
drawing is a stream of graphical commands.


Andrew Fedoniouk.
http://terrainformatica.com
Received on Monday, 3 July 2006 15:01:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:47 UTC