-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Make setTransform() and addPath() accept DOMMatrixInit #965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3619,7 +3619,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d | |
| <ul class="brief"> | ||
| <li><dfn data-noexport="" data-x-href="https://drafts.fxtf.org/geometry/#dommatrix"><code>DOMMatrix</code></dfn> interface | ||
| <li><dfn data-noexport="" data-x-href="https://drafts.fxtf.org/geometry/#dictdef-dommatrixinit"><code>DOMMatrixInit</code></dfn> interface | ||
| <li>The <dfn data-noexport="" data-x-href="https://drafts.fxtf.org/geometry/#validate-and-fixup">validate and fixup</dfn> algorithm for DOMMatrixInit | ||
| <li>The <dfn data-noexport="" data-x-href="https://drafts.fxtf.org/geometry/#create-a-dommatrix-from-the-dictionary">create a <code>DOMMatrix</code> from a dictionary</dfn> algorithm for <code>DOMMatrixInit</code> | ||
| </ul> | ||
|
|
||
| <!-- mention that the parser supports it? --> | ||
|
|
@@ -60127,7 +60127,7 @@ interface <dfn>CanvasTransform</dfn> { | |
|
|
||
| [NewObject] <span>DOMMatrix</span> <span data-x="dom-context-2d-getTransform">getTransform</span>(); | ||
| void <span data-x="dom-context-2d-setTransform">setTransform</span>(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f); | ||
| void <span data-x="dom-context-2d-setTransform">setTransform</span>(optional <span>DOMMatrixInit</span> matrix); | ||
| void <span data-x="dom-context-2d-setTransform">setTransform</span>(optional <span>DOMMatrixInit</span> transform); | ||
| void <span data-x="dom-context-2d-resetTransform">resetTransform</span>(); | ||
| <!-- | ||
| // v7 we've also received requests (though not many so far) for: | ||
|
|
@@ -60302,7 +60302,7 @@ interface <dfn>CanvasGradient</dfn> { | |
|
|
||
| interface <dfn>CanvasPattern</dfn> { | ||
| // opaque object | ||
| void <span data-x="dom-canvaspattern-setTransform">setTransform</span>(<span>DOMMatrix</span> transform); | ||
| void <span data-x="dom-canvaspattern-setTransform">setTransform</span>(optional <span>DOMMatrixInit</span> transform); | ||
| }; | ||
|
|
||
| interface <dfn>TextMetrics</dfn> { | ||
|
|
@@ -60351,7 +60351,7 @@ interface <dfn>ImageData</dfn> { | |
| <span data-x="dom-Path2D-merge">Constructor</span>(sequence<<span>Path2D</span>> paths, optional <span>CanvasFillRule</span> fillRule = "<span data-x="dom-context-2d-fillRule-nonzero">nonzero</span>"), | ||
|
||
| <span data-x="dom-Path2D-withdata">Constructor</span>(DOMString d), Exposed=(Window,Worker)] | ||
| interface <dfn>Path2D</dfn> { | ||
| void <span data-x="dom-Path2D-addPath">addPath</span>(<span>Path2D</span> path, optional <span>DOMMatrix</span>? transformation = null); | ||
| void <span data-x="dom-Path2D-addPath">addPath</span>(<span>Path2D</span> path, optional <span>DOMMatrixInit</span> transform); | ||
| }; | ||
| <span>Path2D</span> implements <span>CanvasPath</span>;</pre> | ||
|
|
||
|
|
@@ -62444,8 +62444,12 @@ try { | |
|
|
||
|
||
| <li><p>Create a copy of all the subpaths in <var>b</var>. Let this copy be known as <var>c</var>.</p></li> | ||
|
|
||
| <li><p>Let <var>matrix</var> be the result of <span data-x="create a DOMMatrix from a | ||
| dictionary">creating a <code>DOMMatrix</code> from a dictionary</span> | ||
| <var>transform</var>.</p></li> | ||
|
|
||
| <li><p>Transform all the coordinates and lines in <var>c</var> by the transform matrix | ||
| <var>transform</var>, if it is not null.</p></li> | ||
| <var>matrix</var>.</p></li> | ||
|
|
||
| <li><p>Let (<var>x</var>, <var>y</var>) be the last point in the last subpath | ||
| of <var>c</var>.</p></li> | ||
|
|
@@ -62541,7 +62545,7 @@ try { | |
|
|
||
| </dd> | ||
|
|
||
| <dt><var>context</var> . <code data-x="dom-context-2d-setTransform">setTransform</code>(<var>matrix</var>)</dt> | ||
| <dt><var>context</var> . <code data-x="dom-context-2d-setTransform">setTransform</code>(<var>transform</var>)</dt> | ||
|
|
||
| <dd> | ||
|
|
||
|
|
@@ -62628,9 +62632,10 @@ try { | |
| data-x=""><span data-x="dom-context-2d-transform">transform</span>(<var>a</var>, <var>b</var>, | ||
| <var>c</var>, <var>d</var>, <var>e</var>, <var>f</var>)</code> method with the same arguments.</p> | ||
|
|
||
| <p>The <dfn><code data-x="">setTransform(<var>matrix</var>)</code></dfn> method must | ||
| <p>The <dfn><code data-x="">setTransform(<var>transform</var>)</code></dfn> method must | ||
| reset the <span>current transformation matrix</span> to the value represented by the result of | ||
| running the <span>validate and fixup</span> algorithm on <var>matrix</var>.</p> | ||
| <span data-x="create a DOMMatrix from a dictionary">creating a <code>DOMMatrix</code> from a | ||
| dictionary</span> <var>transform</var>.</p> | ||
|
|
||
| <p>The <dfn><code data-x="dom-context-2d-resetTransform">resetTransform()</code></dfn> method must | ||
| reset the <span>current transformation matrix</span> to the identity matrix.</p> | ||
|
|
@@ -63071,9 +63076,11 @@ try { | |
| <p>Patterns have a transformation matrix, which controls how the pattern is used when it is | ||
|
||
| painted. Initially, a pattern's transformation matrix must be the identity transform.</p> | ||
|
|
||
| <p>When the <dfn><code data-x="dom-canvaspattern-setTransform">setTransform()</code></dfn> method | ||
| is invoked on the pattern, the user agent must replace the pattern's transformation matrix with | ||
| the one described by the <code>DOMMatrix</code> object provided as an argument to the method.</p> | ||
| <p>The <dfn><code | ||
|
||
| data-x="dom-canvaspattern-setTransform">setTransform(<var>transform</var>)</code></dfn> method, | ||
| when invoked, must reset the pattern's transformation matrix to the value represented by the | ||
| result of <span data-x="create a DOMMatrix from a dictionary">creating a <code>DOMMatrix</code> | ||
| from a dictionary</span> <var>transform</var>.</p> | ||
|
|
||
| <p>When a pattern is to be rendered within an area, the user agent must run the following steps to | ||
| determine what is rendered:</p> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional