Commit 5b08378
authored
[vector_graphics_compiler] Set the m4_10 (Z scale) value to 1 when constructing an AffineMatrix from an SVG matrix (#9813)
The 4x4 matrix produced by the SVG matrix() function should have its 10th element set to 1. (see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix)
The SVG matrix parser constructs an AffineMatrix from the SVG input. The AffineMatrix is then converted into a list that is given to Flutter engine APIs.
Before flutter/engine@62cb2c9, the Flutter engine was implicitly overriding the 10th element of the matrix with a 1 value. After that commit, the engine uses the matrix contents as is and does not override any values.
This PR changes the SVG matrix parser to explicitly set the AffineMatrix m4_10 parameter to 1. This reflects the SVG spec and produces output that matches the original engine behavior.
See flutter/flutter#1718541 parent 5866014 commit 5b08378
File tree
5 files changed
+8
-7
lines changed- packages/vector_graphics_compiler
- lib/src/svg
- test
5 files changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
0 commit comments