Esempio n. 1
0
        static void Identity_pts(uiMatrix3 m, uiOffset[] dst, uiOffset[] src, int count)
        {
            D.assert(m._getType() == 0);

            if (dst != src && count > 0)
            {
                Array.Copy(src, dst, count);
            }
        }
Esempio n. 2
0
 static void Trans_pts(uiMatrix3 m, uiOffset[] dst, uiOffset[] src, int count)
 {
     D.assert(m._getType() <= TypeMask.kTranslate_Mask);
     if (count > 0)
     {
         var tx = m.getTranslateX();
         var ty = m.getTranslateY();
         for (int i = 0; i < count; ++i)
         {
             dst[i] = new uiOffset(src[i].dx + tx, src[i].dy + ty);
         }
     }
 }
Esempio n. 3
0
        static void Scale_pts(uiMatrix3 m, ref uiOffset[] dst, ref 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);
                }
            }
        }
Esempio n. 4
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);
                }
            }
        }