Commit 30dac585 authored by Matt Perry's avatar Matt Perry

Canvas.concat takes a 16-element Float32List instead of an array.

The array should be in column-major format, in the format used by vector_math.dart.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1155193004
parent 433df32c
...@@ -8,6 +8,7 @@ div { ...@@ -8,6 +8,7 @@ div {
<div id="canvas" /> <div id="canvas" />
<script> <script>
import 'dart:math' as math; import 'dart:math' as math;
import 'dart:typed_data';
import 'dart:sky'; import 'dart:sky';
void main() { void main() {
...@@ -29,11 +30,12 @@ void main() { ...@@ -29,11 +30,12 @@ void main() {
paint); paint);
// Scale x and y by 0.5. // Scale x and y by 0.5.
var scaleMatrix = [ var scaleMatrix = new Float32List.fromList([
0.5, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0,
0.0, 0.5, 0.0, 0.0, 0.5, 0.0, 0.0,
0.0, 0.0, 1.0 0.0, 0.0, 0.0, 0.0,
]; 0.0, 0.0, 0.0, 1.0,
]);
context.concat(scaleMatrix); context.concat(scaleMatrix);
paint.color = const Color.fromARGB(128, 0, 255, 0); paint.color = const Color.fromARGB(128, 0, 255, 0);
context.drawCircle(0.0, 0.0, radius, paint); context.drawCircle(0.0, 0.0, radius, paint);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment