- From: poot <cvsmail@w3.org>
- Date: Mon, 05 Mar 2012 18:04:48 -0500
- To: public-html-diffs@w3.org
2Dapi; hixie: Extract the transformation matrix API from canvas so we can reuse it with Path and Pattern objects. (whatwg r7015) http://dev.w3.org/cvsweb/html5/2dcontext/Overview.html?r1=1.121&r2=1.122&f=h http://html5.org/tools/web-apps-tracker?from=7014&to=7015 =================================================================== RCS file: /sources/public/html5/2dcontext/Overview.html,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- Overview.html 29 Feb 2012 23:39:30 -0000 1.121 +++ Overview.html 5 Mar 2012 23:04:38 -0000 1.122 @@ -320,7 +320,7 @@ <h1>HTML Canvas 2D Context</h1> <h2 class="no-num no-toc" id="generatedID"></h2> - <h2 class="no-num no-toc" id="editor-s-draft-29-february-2012">Editor's Draft 29 February 2012</h2> + <h2 class="no-num no-toc" id="editor-s-draft-5-march-2012">Editor's Draft 5 March 2012</h2> <dl><dt>Latest Published Version:</dt> <dd><a href="http://www.w3.org/TR/2dcontext/">http://www.w3.org/TR/2dcontext/</a></dd> <dt>Latest Editor's Draft:</dt> @@ -456,7 +456,7 @@ Group</a> is the W3C working group responsible for this specification's progress along the W3C Recommendation track. - This specification is the 29 February 2012 Editor's Draft. + This specification is the 5 March 2012 Editor's Draft. </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>Work on this specification is also done at the <a href="http://www.whatwg.org/">WHATWG</a>. The W3C HTML working group actively pursues convergence with the WHATWG, as required by the <a href="http://www.w3.org/2007/03/HTML-WG-charter">W3C HTML working group charter</a>.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>This specification is an extension to the HTML5 language. All @@ -512,12 +512,6 @@ void <a href="#dom-context-2d-save" title="dom-context-2d-save">save</a>(); // push state on state stack void <a href="#dom-context-2d-restore" title="dom-context-2d-restore">restore</a>(); // pop state stack and restore state - // transformations (default transform is the identity matrix) - void <a href="#dom-context-2d-scale" title="dom-context-2d-scale">scale</a>(double x, double y); - void <a href="#dom-context-2d-rotate" title="dom-context-2d-rotate">rotate</a>(double angle); - void <a href="#dom-context-2d-translate" title="dom-context-2d-translate">translate</a>(double x, double y); - void <a href="#dom-context-2d-transform" title="dom-context-2d-transform">transform</a>(double a, double b, double c, double d, double e, double f); - void <a href="#dom-context-2d-settransform" title="dom-context-2d-setTransform">setTransform</a>(double a, double b, double c, double d, double e, double f); // compositing attribute double <a href="#dom-context-2d-globalalpha" title="dom-context-2d-globalAlpha">globalAlpha</a>; // (default 1.0) @@ -585,6 +579,18 @@ void <a href="#dom-context-2d-putimagedata" title="dom-context-2d-putImageData">putImageData</a>(<a href="#imagedata">ImageData</a> imagedata, double dx, double dy); void <a href="#dom-context-2d-putimagedata" title="dom-context-2d-putImageData">putImageData</a>(<a href="#imagedata">ImageData</a> imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight); }; +<a href="#canvasrenderingcontext2d">CanvasRenderingContext2D</a> implements <a href="#canvastransformation">CanvasTransformation</a>; + +[NoInterfaceObject] +interface <dfn id="canvastransformation">CanvasTransformation</dfn> { + // transformations (default transform is the identity matrix) + void <a href="#dom-context-2d-scale" title="dom-context-2d-scale">scale</a>(double x, double y); + void <a href="#dom-context-2d-rotate" title="dom-context-2d-rotate">rotate</a>(double angle); + void <a href="#dom-context-2d-translate" title="dom-context-2d-translate">translate</a>(double x, double y); + void <a href="#dom-context-2d-transform" title="dom-context-2d-transform">transform</a>(double a, double b, double c, double d, double e, double f); + void <a href="#dom-context-2d-settransform" title="dom-context-2d-setTransform">setTransform</a>(double a, double b, double c, double d, double e, double f); + +}; interface <dfn id="canvasgradient">CanvasGradient</dfn> { // opaque object @@ -618,8 +624,8 @@ context paints on.</p> <p>Except where otherwise specified, for the 2D context interface, - any method call with a numeric argument whose value is infinite or a - NaN value must be ignored.</p> + <strong>any method call with a numeric argument whose value is + infinite or a NaN value must be ignored</strong>.</p> @@ -687,16 +693,19 @@ </div><h2 id="transformations"><span class="secno">3 </span><dfn title="dom-context-2d-transformation">Transformations</dfn></h2><p>The transformation matrix is applied to coordinates when creating shapes and paths.</p><div class="impl"> - <p>When the context is created, the transformation matrix must - initially be the identity transform. It may then be adjusted using - the transformation methods.</p> + <p>Any object that implements the <code><a href="#canvastransformation">CanvasTransformation</a></code> + interface has a <i>current transformation matrix</i>. When such an + object is created, its transformation matrix must be initialized to + the identity transform. It may then be adjusted using the + transformation methods described in this section.</p> - <p>The transformations must be performed in reverse order. For - instance, if a scale transformation that doubles the width is - applied, followed by a rotation transformation that rotates drawing - operations by a quarter turn, and a rectangle twice as wide as it is - tall is then drawn on the canvas, the actual result will be a - square.</p> + <p>The transformations must be performed in reverse order.</p> + + <p class="note">For instance, if a scale transformation that doubles + the width is applied to the canvas, followed by a rotation + transformation that rotates drawing operations by a quarter turn, + and a rectangle twice as wide as it is tall is then drawn on the + canvas, the actual result will be a square.</p> </div><dl class="domintro"><dt><var title="">context</var> . <code title="dom-context-2d-scale"><a href="#dom-context-2d-scale">scale</a></code>(<var title="">x</var>, <var title="">y</var>)</dt>
Received on Monday, 5 March 2012 23:04:50 UTC