diff --git a/src/lime/math/Matrix3.hx b/src/lime/math/Matrix3.hx index b9e42356a..4145b799d 100644 --- a/src/lime/math/Matrix3.hx +++ b/src/lime/math/Matrix3.hx @@ -22,7 +22,7 @@ import lime.utils.Float32Array; @:fileXml('tags="haxe,release"') @:noDebug #end -abstract Matrix3(Float32Array) from Float32Array to Float32Array +abstract Matrix3(Float32Array) to Float32Array { /** The matrix a component, used in scaling and skewing (default is 1) @@ -335,6 +335,16 @@ abstract Matrix3(Float32Array) from Float32Array to Float32Array return new Matrix3(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty); } + @:from private static inline function fromFloat32Array(array:Float32Array):Matrix3 + { + if (array.length != 9) + { + throw "Expected array of length 9, got " + array.length; + } + + return cast array; + } + /** Resets the matrix to default identity values **/