avm2: Add missing [API()] to flash.geom

This commit is contained in:
MartySVK 2024-08-13 08:32:23 +02:00 committed by TÖRÖK Attila
parent b33423c27f
commit 24478ff43f
5 changed files with 18 additions and 0 deletions

View File

@ -36,11 +36,13 @@ package flash.geom {
this.ty = ty;
}
[API("674")]
public function copyColumnFrom(column:uint, vector3D:Vector3D):void {
// FP BUG: For some reason these methods are identical
this.copyRowFrom(column, vector3D);
}
[API("674")]
public function copyColumnTo(column:uint, vector3D:Vector3D):void {
if(column == 0) {
vector3D.x = this.a;
@ -59,6 +61,7 @@ package flash.geom {
} // otherwise vector is unchanged
}
[API("674")]
public function copyFrom(sourceMatrix: Matrix): void {
this.a = sourceMatrix.a;
this.b = sourceMatrix.b;
@ -68,6 +71,7 @@ package flash.geom {
this.ty = sourceMatrix.ty;
}
[API("674")]
public function copyRowFrom(row: uint, vector3D: Vector3D): void {
if (row == 0) {
this.a = vector3D.x;
@ -80,6 +84,7 @@ package flash.geom {
} // otherwise matrix is unchanged
}
[API("674")]
public function copyRowTo(row:uint, vector3D:Vector3D):void {
if(row == 0) {
vector3D.x = this.a;
@ -167,6 +172,7 @@ package flash.geom {
this.ty *= sy;
}
[API("674")]
public function setTo(aa:Number, ba:Number, ca:Number, da:Number, txa:Number, tya:Number):void {
this.a = aa;
this.b = ba;

View File

@ -90,6 +90,7 @@ package flash.geom {
this.append(m);
}
[API("674")]
public function copyRawDataFrom(vector:Vector.<Number>, index:uint = 0, transpose:Boolean = false):void {
if (transpose) {
this.transpose();
@ -107,6 +108,7 @@ package flash.geom {
}
// Based on https://github.com/openfl/openfl/blob/develop/src/openfl/geom/Matrix3D.hx#L542C1-L573
[API("674")]
public function copyRowTo(row:uint, vector3D:Vector3D):void {
if (row > 3) {
throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004);
@ -141,6 +143,7 @@ package flash.geom {
}
// Based on https://github.com/openfl/openfl/blob/develop/src/openfl/geom/Matrix3D.hx#L504-L534
[API("674")]
public function copyRowFrom(row:uint, vector3D:Vector3D):void {
if (row > 3) {
throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004);
@ -377,11 +380,13 @@ package flash.geom {
this.prepend(m);
}
[API("674")]
public function copyFrom(other:Matrix3D):void {
// This makes a copy of other.rawData
this._rawData = other.rawData;
}
[API("674")]
public function copyRawDataTo(vector:Vector.<Number>, index:uint = 0, transpose:Boolean = false):void {
if (transpose) {
this.transpose();
@ -502,6 +507,7 @@ package flash.geom {
return !(components[2].x == 0 || components[2].y == 0 || components[2].y == 0);
}
[API("674")]
public function copyColumnTo(column:uint, vector3D:Vector3D):void {
if (column > 3) {
throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004);
@ -537,6 +543,7 @@ package flash.geom {
}
}
[API("674")]
public function copyColumnFrom(column:uint, vector3D:Vector3D):void {
if (column > 3) {
throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004);

View File

@ -28,6 +28,7 @@ package flash.geom {
return new Point(this.x, this.y);
}
[API("674")]
public function copyFrom(sourcePoint:Point):void {
this.x = sourcePoint.x;
this.y = sourcePoint.y;
@ -51,6 +52,7 @@ package flash.geom {
this.y += dy;
}
[API("674")]
public function setTo(xa:Number, ya:Number):void {
this.x = xa;
this.y = ya;

View File

@ -191,6 +191,7 @@ package flash.geom {
this.height = sourceRect.height;
}
[API("674")]
public function setTo(xa: Number, ya: Number, widtha: Number, heighta: Number): void {
this.x = xa;
this.y = ya;

View File

@ -66,6 +66,7 @@ package flash.geom {
return new Vector3D(this.x, this.y, this.z, this.w);
}
[API("674")]
public function copyFrom(sourceVector3D:Vector3D):void {
this.x = sourceVector3D.x;
this.y = sourceVector3D.y;
@ -87,6 +88,7 @@ package flash.geom {
&& (!allFour || Math.abs(toCompare.w) < tolerance); // FP BUG
}
[API("674")]
public function setTo(xa:Number, ya:Number, za: Number):void {
this.x = xa;
this.y = ya;