Exemple #1
0
        void Skew()
        {
            var skew = Parameters["Skew"] as ObjcParameter;

            if (skew != null)
            {
                double horizontal = skew.GetValueAsDouble("Hrzn");
                double vertical   = skew.GetValueAsDouble("Vrtc");

                Console.WriteLine("Skew: {0} {1}", horizontal, vertical);

                if (horizontal != 0.0)
                {
                    double offset = ActiveDrawable.Height *
                                    Math.Tan(GetRad(horizontal));
                    SelectedLayer.TransformShear(OrientationType.Horizontal, offset,
                                                 true, TransformResize.Adjust);
                }

                if (vertical != 0.0)
                {
                    double offset = ActiveDrawable.Width * Math.Tan(GetRad(vertical));
                    SelectedLayer.TransformShear(OrientationType.Vertical, offset,
                                                 true, TransformResize.Adjust);
                }
            }
        }