HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/1158

File a bug

SVNBugCommentTime (UTC)
1158[Opera] Transformations affect path creation as well as stroking and filling.2008-01-15 07:44
Index: source
===================================================================
--- source	(revision 1157)
+++ source	(revision 1158)
@@ -13731,8 +13731,8 @@
   title="drawing state">Drawing states</dfn> consist of:</p>
 
   <ul class="brief">
-   <li>The current transformation matrix.</li>
-   <li>The current clip region.</li>
+   <li>The current <span title="dom-context-2d-transformation">transformation matrix</span>.</li>
+   <li>The current <span>clipping path</span>.</li>
    <li>The current values of the following attributes: <code
    title="dom-context-2d-strokeStyle">strokeStyle</code>, <code
    title="dom-context-2d-fillStyle">fillStyle</code>, <code
@@ -13766,12 +13766,11 @@
   must do nothing.</p>
 
 
-  <h6><dfn>Transformations</dfn></h6>
+  <h6><dfn title="dom-context-2d-transformation">Transformations</dfn></h6>
 
-  <p>The transformation matrix is applied to all drawing operations
-  prior to their being rendered. It is also applied when creating the
-  clip region.</p> <!-- conformance criteria for actual drawing are
-  described in "drawing model" below -->
+  <p>The transformation matrix is applied to coordinates when creating
+  shapes and paths.</p> <!-- conformance criteria for actual drawing
+  are described in the various sections below -->
 
   <p>When the context is created, the transformation matrix must
   initially be the identity transform. It may then be adjusted using
@@ -14427,15 +14426,26 @@
   <p>There are three methods that immediately draw rectangles to the
   bitmap. They each take four arguments; the first two give the <var
   title="">x</var> and <var title="">y</var> coordinates of the top
-  left of the rectangle, and the second two give the width and height
-  of the rectangle, respectively.</p>
+  left of the rectangle, and the second two give the width <var
+  title="">w</var> and height <var title="">h</var> of the rectangle,
+  respectively.</p>
 
+  <p>The <span title="dom-context-2d-transformation">current
+  transformation matrix</span> must be applied to the following four
+  coordinates, which form the path that must then be closed to get the
+  specified rectangle: <span>(<var title="">x</var>, <var
+  title="">y</var>)</span>, <span>(<span><var title="">x</var>+<var
+  title="">w</var></span>, <var title="">y</var>)</span>,
+  <span>(<span><var title="">x</var>+<var title="">w</var></span>,
+  <span><var title="">y</var>+<var title="">h</var></span>)</span>,
+  <span>(<var title="">x</var>, <span><var title="">y</var>+<var
+  title="">h</var></span>)</span>.</p>
+
   <p>Shapes are painted without affecting the current path, and are
-  subject to <span title="dom-context-2d-">transformations</span>,
-  <span title="shadows">shadow effects</span>, <span
-  title="globalAlpha">global alpha</span>, <span title="clipping
-  path">clipping paths</span>, and <span
-  title="globalCompositeOperation">global composition
+  subject to <span title="shadows">shadow effects</span>, <span
+  title="dom-context-2d-globalAlpha">global alpha</span>, <span
+  title="clipping path">clipping paths</span>, and <span
+  title="dom-context-2d-globalCompositeOperation">global composition
   operators</span>.</p>
 
   <p>Negative values for width and height must cause the
@@ -14456,9 +14466,8 @@
 
   <p>The <dfn
   title="dom-context-2d-strokeRect"><code>strokeRect()</code></dfn>
-  method must draw stroke the path that would be created for the
-  outline of a rectangle of the specified size using the <code
-  title="dom-context-2d-strokeStyle">strokeStyle</code>, <code
+  method must draw stroke the specified rectangle's path using the
+  <code title="dom-context-2d-strokeStyle">strokeStyle</code>, <code
   title="dom-context-2d-lineWidth">lineWidth</code>, <code
   title="dom-context-2d-lineJoin">lineJoin</code>, and (if
   appropriate) <code
@@ -14485,7 +14494,13 @@
 
   <p>Initially, the context's path must have zero subpaths.</p>
 
+  <p>The coordinates given in the arguments to these methods must be
+  transformed according to the <span
+  title="dom-context-2d-transformation">current transformation
+  matrix</span> before applying the calculations described below and
+  before adding any points to the path.</p>
 
+
   <p>The <dfn
   title="dom-context-2d-beginPath"><code>beginPath()</code></dfn>
   method must empty the list of subpaths so that the context once
@@ -14664,8 +14679,7 @@
   <p>The <dfn title="dom-context-2d-clip"><code>clip()</code></dfn>
   method must create a new <dfn>clipping path</dfn> by calculating the
   intersection of the current clipping path and the area described by
-  the current path (after applying the <span>current
-  transformation</span>), using the non-zero winding number rule. Open
+  the current path, using the non-zero winding number rule. Open
   subpaths must be implicitly closed when computing the clipping path,
   without affecting the actual subpaths.</p>
 
@@ -14742,15 +14756,16 @@
   title="">sw</var>, <var title="">sh</var>) must be painted on the
   region of the canvas specified by the destination rectangle (<var
   title="">dx</var>, <var title="">dy</var>, <var title="">dw</var>,
-  <var title="">dh</var>).</p>
+  <var title="">dh</var>), after applying the <span
+  title="dom-context-2d-transformation">current transformation
+  matrix</span>.</p>
 
   <p><img src="images/drawImage.png" alt=""></p> <!-- no alt="" text
   since the image is just repeating what was stated in the previous
   paragraph. -->
 
   <p>Images are painted without affecting the current path, and are
-  subject to <span>transformations</span>, <span
-  title="shadows">shadow effects</span>, <span
+  subject to <span title="shadows">shadow effects</span>, <span
   title="dom-context-2d-globalAlpha">global alpha</span>, <span
   title="clipping path">clipping paths</span>, and <span
   title="dom-context-2d-globalCompositeOperation">global composition
@@ -14925,16 +14940,11 @@
 
   <ol>
 
-   <li>If the current transformation matrix is infinite, then do
-   nothing. Abort these steps.</li>
-
-   <li>The coordinates are transformed by the current transformation
-   matrix.</li>
-
    <li>The shape or image is rendered, creating image <var
    title="">A</var>, as described in the previous sections. For
-   shapes, the current fill, stroke, and line styles must be
-   honoured.</li>
+   shapes, the current fill, stroke, and line styles must be honoured,
+   and the stroke must itself also be subjected to the current
+   transformation matrix.</li>
 
    <li>The shadow is rendered from image <var title="">A</var>, using
    the current shadow styles, creating image <var
@@ -14946,13 +14956,15 @@
    <li>The source image has its alpha adjusted by <code
    title="dom-context-2d-globalAlpha">globalAlpha</code>.</li>
 
-   <li>Within the clip region (as affected by the current
-   transformation matrix), the source image is composited over the
-   current canvas bitmap using the current composition operator.</li>
+   <li>Within the clipping path, the source image is composited over
+   the current canvas bitmap using the current composition
+   operator.</li>
 
   </ol>
 
+  <!-- XXX add xrefs in the list above -->
 
+
 <!--
   <h5 id="3d">The 3D context</h5>
 

|