public RotateTransform(Angle angle) { Angle = angle; Point = new PxPoint(0, 0); HasCentre = false; Matrix = PxMatrix.Rotate(angle.ToRadians()); }
public RotateTransform(Angle angle, float x, float y) { Angle = angle; Point = new PxPoint(x, y); HasCentre = true; Matrix = PxMatrix.Translate(-x, -y) * PxMatrix.Rotate(angle.ToRadians()) * PxMatrix.Translate(x, y); }
public PxMatrix Resolve(IElement element, IFrameContext context) { if (!HasCentre) { return(PxMatrix.Rotate(_radians)); } var x = X.Resolve(element, context); var y = Y.Resolve(element, context); return (PxMatrix.Translate(-x, -y) * PxMatrix.Rotate(_radians) * PxMatrix.Translate(x, y)); }