Revert the code for SetScaleTranslate (#1452)
This commit is contained in:
Родитель
adccd31c4f
Коммит
67e322ed97
|
@ -288,8 +288,20 @@ namespace SkiaSharp
|
|||
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
[Obsolete ("Use CreateScaleTranslation(float, float, float, float) instead.")]
|
||||
public void SetScaleTranslate (float sx, float sy, float tx, float ty) =>
|
||||
CreateScaleTranslation (sx, sy, tx, ty);
|
||||
public void SetScaleTranslate (float sx, float sy, float tx, float ty)
|
||||
{
|
||||
scaleX = sx;
|
||||
skewX = 0;
|
||||
transX = tx;
|
||||
|
||||
skewY = 0;
|
||||
scaleY = sy;
|
||||
transY = ty;
|
||||
|
||||
persp0 = 0;
|
||||
persp1 = 0;
|
||||
persp2 = 1;
|
||||
}
|
||||
|
||||
// Rotate
|
||||
|
||||
|
|
|
@ -227,5 +227,20 @@ namespace SkiaSharp.Tests
|
|||
Assert.Equal(10, newPoint.X, PRECISION);
|
||||
Assert.Equal(40, newPoint.Y, PRECISION);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
[SkippableFact]
|
||||
public void SetScaleTranslateWorksCorrectly()
|
||||
{
|
||||
var tempMatrix = SKMatrix.MakeIdentity();
|
||||
|
||||
tempMatrix.Values = new float[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
|
||||
|
||||
SKMatrix.RotateDegrees(ref tempMatrix, 0);
|
||||
|
||||
tempMatrix.SetScaleTranslate(1.2f, 1.0f, 0, 0);
|
||||
|
||||
Assert.Equal(1.2f, tempMatrix.Values[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче