예제 #1
0
 public RotateTransform(Angle angle)
 {
     Angle     = angle;
     Point     = new PxPoint(0, 0);
     HasCentre = false;
     Matrix    = PxMatrix.Rotate(angle.ToRadians());
 }
예제 #2
0
 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);
 }
예제 #3
0
        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));
        }