コード例 #1
0
ファイル: MaskDrawer.cs プロジェクト: PlumpMath/Cross.Drawing
 /// <summary>
 /// Restore the state of this drawer
 /// </summary>
 public void Load(object state)
 {
     if (state is DrawerState)
     {
         DrawerState ds = (DrawerState)state;
         currentTransform  = ds.CurrentTransform;
         matrixStack       = ds.MatrixStack;
         transformRequired = currentTransform != null;
     }
     else
     {
         IncompatibleTypeException.Publish(state, typeof(DrawerState));
     }
 }
コード例 #2
0
ファイル: MaskDrawer.cs プロジェクト: PlumpMath/Cross.Drawing
        /// <summary>
        /// Create a new transformation matrix and make it active
        /// </summary>
        public void PushMatrix()
        {
            if (currentTransform == null)
            {
                currentTransform = new Matrix3x3();
            }
            else
            {
                //store current transform to stack
                if (matrixStack == null)
                {
                    matrixStack = new Matrix3x3Stack();
                }
                matrixStack.Push(currentTransform);

                //create a new matrix
                currentTransform = currentTransform.Clone();
            }

            transformRequired = true;
        }
コード例 #3
0
 private Matrix3x3Stack(Matrix3x3Stack source)
     : base(source)
 {
 }