TranslateTransform
Represents the translate3d transformation.
namespace AngleSharp.Css.Values
{
internal sealed class TranslateTransform : ITransform
{
private readonly Length _x;
private readonly Length _y;
private readonly Length _z;
public Length Dx => _x;
public Length Dy => _y;
public Length Dz => _z;
internal TranslateTransform(Length x, Length y, Length z)
{
_x = x;
_y = y;
_z = z;
}
public TransformMatrix ComputeMatrix()
{
Length length = _x;
float tx = length.ToPixel();
length = _y;
float ty = length.ToPixel();
length = _z;
float tz = length.ToPixel();
return new TransformMatrix(1, 0, 0, 0, 1, 0, 0, 0, 1, tx, ty, tz, 0, 0, 0);
}
}
}