Skip to content

Commit 4112e17

Browse files
committed
Add note about side effects on converting transform functions to matrix.
1 parent c1201ba commit 4112e17

3 files changed

Lines changed: 89 additions & 7 deletions

File tree

css3-transforms/ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2012-05-26 dschulze@adobe.com
2+
Add note about side effects on converting transform functions to matrix.
3+
14
2012-05-28 ayg@aryeh.name
25
Define how exactly to apply perspective (w-parameter)
36
Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=15605

css3-transforms/Overview.html

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ <h3 id=svg-animate-element><span class=secno>14.1. </span> Elements,
22332233

22342234
<tbody>
22352235
<tr>
2236-
<td><var>&lt;transform-list&gt;</var>
2236+
<th><var>&lt;transform-list&gt;</var>
22372237

22382238
<td>yes
22392239

@@ -2245,11 +2245,12 @@ <h3 id=svg-animate-element><span class=secno>14.1. </span> Elements,
22452245

22462246
<td>yes
22472247

2248-
<td>Additive means that a transformation is post-multiplied to the base
2249-
set of transformations.
2248+
<td>Additive for ‘<code class=property>animateTransform</code>
2249+
means that a transformation is post-multiplied to the base set of
2250+
transformations.
22502251

22512252
<tr>
2252-
<td><var>&lt;translation-value&gt;</var>
2253+
<th><var>&lt;translation-value&gt;</var>
22532254

22542255
<td>yes
22552256

@@ -2863,6 +2864,43 @@ <h2 id=matrix-interpolation><span class=secno>20. </span> Interpolation of
28632864
numerically</a> and <a href=matrix-recomposing>recomposed back to a
28642865
matrix</a> in a final step.
28652866

2867+
<div class=note>
2868+
<p> In the following example the element gets translated by 100 pixel in
2869+
both the X and Y directions and rotated by 1170 degree on hovering. The
2870+
initial transformation is 45 degree. With the usage of transition, an
2871+
author might expect a animated, clockwise rotation by three and a quarter
2872+
turn (1170 degree).</p>
2873+
2874+
<pre>
2875+
&lt;style&gt;
2876+
div {
2877+
transform: rotate(45deg);
2878+
}
2879+
div:hover {
2880+
transform: translate(100px, 100px) rotate(1215deg);
2881+
transition: transform 3s;
2882+
}
2883+
&lt;/style&gt;
2884+
2885+
&lt;div&gt;&lt;/div&gt;</pre>
2886+
2887+
<p> The number of transform functions on the source transform ‘<code
2888+
class=css>rotate(45deg)</code>’ differs from the number of transform
2889+
functions on the destination transform ‘<code
2890+
class=css>translate(100px, 100px) rotate(1125deg)</code>’. According to
2891+
the last rule of <a href="#animation">Interpolation of Transforms</a>,
2892+
both transforms must be interpolated by matrix interpolation. With
2893+
converting the transformation functions to matrices, the information
2894+
about the three turns gets lost and the element gets rotated by just a
2895+
quarter turn (90 degree).</p>
2896+
2897+
<p> To achieve the three and a quarter turns for the example above, source
2898+
and destination transforms must fulfill the third rule of <a
2899+
href="#animation">Interpolation of Transforms</a>. Source transform could
2900+
look like ‘<code class=css>translate(0, 0) rotate(45deg)</code>’ for
2901+
a linearly interpolation of the transform functions.</p>
2902+
</div>
2903+
28662904
<h3 id=matrix-decomposing><span class=secno>20.1. </span>Decomposing the
28672905
Matrix</h3>
28682906

css3-transforms/Transforms.src.html

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,17 +2058,17 @@ <h3 id="svg-animate-element">
20582058
</thead>
20592059
<tbody>
20602060
<tr>
2061-
<td><var>&lt;transform-list&gt;</var></td>
2061+
<th><var>&lt;transform-list&gt;</var></th>
20622062
<td>yes</td>
20632063
<td>yes</td>
20642064
<td>yes</td>
20652065
<td>no</td>
20662066
<td>yes</td>
2067-
<td>Additive means that a transformation is post-multiplied to the base set of
2067+
<td>Additive for 'animateTransform' means that a transformation is post-multiplied to the base set of
20682068
transformations.</td>
20692069
</tr>
20702070
<tr>
2071-
<td><var>&lt;translation-value&gt;</var></td>
2071+
<th><var>&lt;translation-value&gt;</var></th>
20722072
<td>yes</td>
20732073
<td>yes</td>
20742074
<td>yes</td>
@@ -2703,6 +2703,47 @@ <h2 id="matrix-interpolation">
27032703
href="matrix-recomposing">recomposed back to a matrix</a> in a final step.
27042704
</p>
27052705

2706+
<div class="note">
2707+
<p>
2708+
In the following example the element gets translated by 100 pixel in both the X
2709+
and Y directions and rotated by 1170 degree on hovering. The initial
2710+
transformation is 45 degree. With the usage of transition, an author might expect
2711+
a animated, clockwise rotation by three and a quarter turn (1170 degree).
2712+
</p>
2713+
2714+
<pre>
2715+
&lt;style&gt;
2716+
div {
2717+
transform: rotate(45deg);
2718+
}
2719+
div:hover {
2720+
transform: translate(100px, 100px) rotate(1215deg);
2721+
transition: transform 3s;
2722+
}
2723+
&lt;/style&gt;
2724+
2725+
&lt;div&gt;&lt;/div&gt;</pre>
2726+
2727+
<p>
2728+
The number of transform functions on the source transform
2729+
''rotate(45deg)'' differs from the number of transform functions on the
2730+
destination transform ''translate(100px, 100px) rotate(1125deg)''.
2731+
According to the last rule of <a href="#animation">Interpolation of
2732+
Transforms</a>, both transforms must be interpolated by matrix interpolation.
2733+
With converting the transformation functions to matrices, the information about
2734+
the three turns gets lost and the element gets rotated by just a quarter turn (90
2735+
degree).
2736+
</p>
2737+
2738+
<p>
2739+
To achieve the three and a quarter turns for the example above, source and
2740+
destination transforms must fulfill the third rule of <a
2741+
href="#animation">Interpolation of Transforms</a>. Source transform could look
2742+
like ''translate(0, 0) rotate(45deg)'' for a linearly interpolation of
2743+
the transform functions.
2744+
</p>
2745+
</div>
2746+
27062747
<h3 id="matrix-decomposing">Decomposing the Matrix</h3>
27072748

27082749
<p>

0 commit comments

Comments
 (0)