Skip to content
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

Add multiplied-out coordinates for canvas transforms #4473

Merged
merged 3 commits into from
May 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
.applies td { text-align: center; }

.matrix, .matrix td { border: hidden; text-align: right; }
.matrix { margin-left: 2em; }
.matrix, .equations { margin-left: 2em; }

.vertical-summary-table tr > th[rowspan="2"]:first-child + th,
.vertical-summary-table tr > td[rowspan="2"]:first-child + td { border-bottom: hidden; }
Expand Down Expand Up @@ -62716,6 +62716,37 @@ try {

</div>

<div class="note">
<p>Given a matrix of the form created by the <code
data-x="dom-context-2d-transform">transform()</code> and <code
data-x="dom-context-2d-setTransform">setTransform()</code> methods, i.e.</p>
Ms2ger marked this conversation as resolved.
Show resolved Hide resolved

<table class="matrix">
<tr>
<td><var>a</var></td>
<td><var>c</var></td>
<td><var>e</var></td>
</tr>
<tr>
<td><var>b</var></td>
<td><var>d</var></td>
<td><var>f</var></td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
</table>

<p>the resulting transformed coordinates after transform matrix multiplication will be</p>

<p class="equations">
<var>x</var><sub>new</sub> = <var>a</var> <var>x</var> + <var>c</var> <var>y</var><br>
<var>y</var><sub>new</sub> = <var>b</var> <var>x</var> + <var>d</var> <var>y</var>
</p>
</div>



<h6>Image sources for 2D rendering contexts</h6>
Expand Down