[html5] r7035 - [giow] (0) Expose the canvas transform as a self-mutating replaceable SVGMatrix. [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Mar 27 16:22:08 PDT 2012


Author: ianh
Date: 2012-03-27 16:22:07 -0700 (Tue, 27 Mar 2012)
New Revision: 7035

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Expose the canvas transform as a self-mutating replaceable SVGMatrix.
Affected topics: Canvas

Modified: complete.html
===================================================================
--- complete.html	2012-03-27 23:19:32 UTC (rev 7034)
+++ complete.html	2012-03-27 23:22:07 UTC (rev 7035)
@@ -34891,6 +34891,7 @@
 
 -->
   // transformations (default transform is the identity matrix)
+           attribute <a href=#svgmatrix>SVGMatrix</a> <a href=#dom-context-2d-currenttransform title=dom-context-2d-currentTransform>currentTransform</a>;
   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);
@@ -35062,7 +35063,7 @@
 <a href=#drawingstyle>DrawingStyle</a> implements <a href=#canvasdrawingstyles>CanvasDrawingStyles</a>;
 
 [<a href=#dom-path title=dom-Path>Constructor</a>,
- <a href=#dom-path-copy title=dom-Path-copy>Constructor</a>(<span>Path path),
+ <a href=#dom-path-copy title=dom-Path-copy>Constructor</a>(<a href=#path>Path</a> path),
  <a href=#dom-path-withdata title=dom-Path-withdata>Constructor</a>(DOMString d)]
 interface <dfn id=path>Path</dfn> {
   void <a href=#dom-path-addpath title=dom-path-addPath>addPath</a>(<a href=#path>Path</a> path, <a href=#svgmatrix>SVGMatrix</a>? transformation);
@@ -35072,7 +35073,7 @@
   void <a href=#dom-path-addtext title=dom-path-addText>addText</a>(DOMString text, <a href=#canvasdrawingstyles>CanvasDrawingStyles</a> styles, <a href=#svgmatrix>SVGMatrix</a>? transformation, <a href=#path>Path</a> path, optional double maxWidth);
   void <a href=#dom-path-addpathbystrokingtext title=dom-path-addPathByStrokingText>addPathByStrokingText</a>(DOMString text, <a href=#canvasdrawingstyles>CanvasDrawingStyles</a> styles, <a href=#svgmatrix>SVGMatrix</a>? transformation, <a href=#path>Path</a> path, optional double maxWidth);
 };
-<a href=#path>Path</a> implements <a href=#canvaspathmethods>CanvasPathMethods</a>;</span></pre>
+<a href=#path>Path</a> implements <a href=#canvaspathmethods>CanvasPathMethods</a>;</pre>
 
  <!-- ARC-ORDER note (see above):
       some demos rely on the precise order of the arc() and arcTo()
@@ -36797,10 +36798,20 @@
 
   </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>
+  <dl class=domintro><dt><var title="">context</var> . <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code> [ = <var title="">value</var> ]</dt>
 
    <dd>
 
+    <p>Returns the transformation matrix, as an <code><a href=#svgmatrix>SVGMatrix</a></code> object.</p>
+
+    <p>Can be set, to change the transformation matrix.</p>
+
+   </dd>
+
+   <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>
+
+   <dd>
+
     <p>Changes the transformation matrix to apply a scaling transformation with the given characteristics.</p>
 
    </dd>
@@ -36839,6 +36850,18 @@
 
   </dl><div class=impl>
 
+  <p>The <dfn id=dom-context-2d-currenttransform title=dom-context-2d-currentTransform><code>currentTransform</code></dfn>,
+  on getting, must return the last object that it was set to. On
+  setting, its value must be changed to the new value, and the
+  transformation matrix must be updated to match the matrix described
+  by the new value. When the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code>
+  object is created, the <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code>
+  attribute must be set a newly created <code><a href=#svgmatrix>SVGMatrix</a></code> object.
+  When the transformation matrix is mutated by the methods described
+  in this section, the last <code><a href=#svgmatrix>SVGMatrix</a></code> object to which the
+  attribute has been set must be mutated in a corresponding
+  fashion.</p>
+
   <p>The <dfn id=dom-context-2d-scale title=dom-context-2d-scale><code>scale(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must
   add the scaling transformation described by the arguments to the
   transformation matrix. The <var title="">x</var> argument represents

Modified: index
===================================================================
--- index	2012-03-27 23:19:32 UTC (rev 7034)
+++ index	2012-03-27 23:22:07 UTC (rev 7035)
@@ -34891,6 +34891,7 @@
 
 -->
   // transformations (default transform is the identity matrix)
+           attribute <a href=#svgmatrix>SVGMatrix</a> <a href=#dom-context-2d-currenttransform title=dom-context-2d-currentTransform>currentTransform</a>;
   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);
@@ -35062,7 +35063,7 @@
 <a href=#drawingstyle>DrawingStyle</a> implements <a href=#canvasdrawingstyles>CanvasDrawingStyles</a>;
 
 [<a href=#dom-path title=dom-Path>Constructor</a>,
- <a href=#dom-path-copy title=dom-Path-copy>Constructor</a>(<span>Path path),
+ <a href=#dom-path-copy title=dom-Path-copy>Constructor</a>(<a href=#path>Path</a> path),
  <a href=#dom-path-withdata title=dom-Path-withdata>Constructor</a>(DOMString d)]
 interface <dfn id=path>Path</dfn> {
   void <a href=#dom-path-addpath title=dom-path-addPath>addPath</a>(<a href=#path>Path</a> path, <a href=#svgmatrix>SVGMatrix</a>? transformation);
@@ -35072,7 +35073,7 @@
   void <a href=#dom-path-addtext title=dom-path-addText>addText</a>(DOMString text, <a href=#canvasdrawingstyles>CanvasDrawingStyles</a> styles, <a href=#svgmatrix>SVGMatrix</a>? transformation, <a href=#path>Path</a> path, optional double maxWidth);
   void <a href=#dom-path-addpathbystrokingtext title=dom-path-addPathByStrokingText>addPathByStrokingText</a>(DOMString text, <a href=#canvasdrawingstyles>CanvasDrawingStyles</a> styles, <a href=#svgmatrix>SVGMatrix</a>? transformation, <a href=#path>Path</a> path, optional double maxWidth);
 };
-<a href=#path>Path</a> implements <a href=#canvaspathmethods>CanvasPathMethods</a>;</span></pre>
+<a href=#path>Path</a> implements <a href=#canvaspathmethods>CanvasPathMethods</a>;</pre>
 
  <!-- ARC-ORDER note (see above):
       some demos rely on the precise order of the arc() and arcTo()
@@ -36797,10 +36798,20 @@
 
   </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>
+  <dl class=domintro><dt><var title="">context</var> . <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code> [ = <var title="">value</var> ]</dt>
 
    <dd>
 
+    <p>Returns the transformation matrix, as an <code><a href=#svgmatrix>SVGMatrix</a></code> object.</p>
+
+    <p>Can be set, to change the transformation matrix.</p>
+
+   </dd>
+
+   <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>
+
+   <dd>
+
     <p>Changes the transformation matrix to apply a scaling transformation with the given characteristics.</p>
 
    </dd>
@@ -36839,6 +36850,18 @@
 
   </dl><div class=impl>
 
+  <p>The <dfn id=dom-context-2d-currenttransform title=dom-context-2d-currentTransform><code>currentTransform</code></dfn>,
+  on getting, must return the last object that it was set to. On
+  setting, its value must be changed to the new value, and the
+  transformation matrix must be updated to match the matrix described
+  by the new value. When the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code>
+  object is created, the <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code>
+  attribute must be set a newly created <code><a href=#svgmatrix>SVGMatrix</a></code> object.
+  When the transformation matrix is mutated by the methods described
+  in this section, the last <code><a href=#svgmatrix>SVGMatrix</a></code> object to which the
+  attribute has been set must be mutated in a corresponding
+  fashion.</p>
+
   <p>The <dfn id=dom-context-2d-scale title=dom-context-2d-scale><code>scale(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must
   add the scaling transformation described by the arguments to the
   transformation matrix. The <var title="">x</var> argument represents

Modified: source
===================================================================
--- source	2012-03-27 23:19:32 UTC (rev 7034)
+++ source	2012-03-27 23:22:07 UTC (rev 7035)
@@ -40573,6 +40573,7 @@
 
 -->
   // transformations (default transform is the identity matrix)
+           attribute <span>SVGMatrix</span> <span title="dom-context-2d-currentTransform">currentTransform</span>;
   void <span title="dom-context-2d-scale">scale</span>(double x, double y);
   void <span title="dom-context-2d-rotate">rotate</span>(double angle);
   void <span title="dom-context-2d-translate">translate</span>(double x, double y);
@@ -40744,7 +40745,7 @@
 <span>DrawingStyle</span> implements <span>CanvasDrawingStyles</span>;
 
 [<span title="dom-Path">Constructor</span>,
- <span title="dom-Path-copy">Constructor</span>(<span>Path</code> path),
+ <span title="dom-Path-copy">Constructor</span>(<span>Path</span> path),
  <span title="dom-Path-withdata">Constructor</span>(DOMString d)]
 interface <dfn>Path</dfn> {
   void <span title="dom-path-addPath">addPath</span>(<span>Path</span> path, <span>SVGMatrix</span>? transformation);
@@ -42823,6 +42824,16 @@
 
   <dl class="domintro">
 
+   <dt><var title="">context</var> . <code title="dom-context-2d-currentTransform">currentTransform</code> [ = <var title="">value</var> ]</dt>
+
+   <dd>
+
+    <p>Returns the transformation matrix, as an <code>SVGMatrix</code> object.</p>
+
+    <p>Can be set, to change the transformation matrix.</p>
+
+   </dd>
+
    <dt><var title="">context</var> . <code title="dom-context-2d-scale">scale</code>(<var title="">x</var>, <var title="">y</var>)</dt>
 
    <dd>
@@ -42867,6 +42878,20 @@
 
   <div class="impl">
 
+  <p>The <dfn
+  title="dom-context-2d-currentTransform"><code>currentTransform</code></dfn>,
+  on getting, must return the last object that it was set to. On
+  setting, its value must be changed to the new value, and the
+  transformation matrix must be updated to match the matrix described
+  by the new value. When the <code>CanvasRenderingContext2D</code>
+  object is created, the <code
+  title="dom-context-2d-currentTransform">currentTransform</code>
+  attribute must be set a newly created <code>SVGMatrix</code> object.
+  When the transformation matrix is mutated by the methods described
+  in this section, the last <code>SVGMatrix</code> object to which the
+  attribute has been set must be mutated in a corresponding
+  fashion.</p>
+
   <p>The <dfn title="dom-context-2d-scale"><code>scale(<var
   title="">x</var>, <var title="">y</var>)</code></dfn> method must
   add the scaling transformation described by the arguments to the
@@ -43888,11 +43913,11 @@
 
    <dt><dfn title="dom-textmetrics-width"><code>width</code></dfn> attribute</dt>
 
-   <dd><p>The width of that inline box, in CSS pixels.</p></p></dd>
+   <dd><p>The width of that inline box, in CSS pixels.</p></dd>
 
    <dt><dfn title="dom-textmetrics-actualBoundingBoxWidth"><code>actualBoundingBoxWidth</code></dfn> attribute</dt>
 
-   <dd><p>The width of the bounding rectangle of the given text, in CSS pixels. This can be wider than the width of the inline box, in particular with slanted fonts where characters overhang their advance width.</p></p></dd>
+   <dd><p>The width of the bounding rectangle of the given text, in CSS pixels. This can be wider than the width of the inline box, in particular with slanted fonts where characters overhang their advance width.</p></dd>
 
    <dt><dfn title="dom-textmetrics-fontBoundingBoxAscent"><code>fontBoundingBoxAscent</code></dfn> attribute</dt>
 




More information about the Commit-Watchers mailing list