public static float getScaleY(uiMatrix3 matrix)
        {
            // ignore perspective parameters for now.
            if (matrix.isIdentity())
            {
                return(1.0f);
            }

            if (matrix.getSkewX() == 0)
            {
                return(matrix.getScaleY());
            }

            var x = matrix.getSkewX();
            var y = matrix.getScaleY();

            return(Mathf.Sqrt(x * x + y * y));
        }
Exemple #2
0
        static void Scale_pts(uiMatrix3 m, uiOffset[] dst, uiOffset[] src, int count)
        {
            D.assert(m._getType() <= (TypeMask.kScale_Mask | TypeMask.kTranslate_Mask));
            if (count > 0)
            {
                var tx = m.getTranslateX();
                var ty = m.getTranslateY();
                var sx = m.getScaleX();
                var sy = m.getScaleY();

                for (int i = 0; i < count; ++i)
                {
                    dst[i] = new uiOffset(src[i].dx * sx + tx, src[i].dy * sy + ty);
                }
            }
        }
Exemple #3
0
        static void Affine_pts(uiMatrix3 m, uiOffset[] dst, uiOffset[] src, int count)
        {
            D.assert(m._getType() != TypeMask.kPerspective_Mask);
            if (count > 0)
            {
                var tx = m.getTranslateX();
                var ty = m.getTranslateY();
                var sx = m.getScaleX();
                var sy = m.getScaleY();
                var kx = m.getSkewX();
                var ky = m.getSkewY();

                for (int i = 0; i < count; ++i)
                {
                    dst[i] = new uiOffset(
                        src[i].dx * sx + src[i].dy * kx + tx,
                        src[i].dx * ky + src[i].dy * sy + ty);
                }
            }
        }