예제 #1
0
 private void InitMatrix(float left, float bottom, float right, float top)
 {
     this.CSCom.SetAnchorPointVisiable(true);
     this.CSCom.SetControlPointVisiable(true);
     if (this.selectedObjects.Count <VisualObject>() == 1)
     {
         VisualObject visualObject = this.selectedParentObjects.FirstOrDefault <VisualObject>();
         this.AnchorPoint = visualObject.GetBoundingAnchorPoint();
         PointF boundingSize = visualObject.GetBoundingSize();
         this.Size         = boundingSize;
         this.Position     = visualObject.Position;
         this.Scale        = visualObject.Scale;
         this.RotationSkew = visualObject.RotationSkew;
         if (!visualObject.OperationFlag.HasFlag(OperationMask.ScaleFlag) && !visualObject.OperationFlag.HasFlag(OperationMask.RotationFlag))
         {
             this.CSCom.SetControlPointVisiable(false);
         }
         this.CSCom.SetAnchorPointVisiable(visualObject.OperationFlag.HasFlag(OperationMask.AnchorMoveFlag));
     }
     else
     {
         this.AnchorPoint  = new ScaleValue(0.5f, 0.5f, 0.1, -99999999.0, 99999999.0);
         this.Size         = new PointF(right - left, top - bottom);
         this.RotationSkew = new ScaleValue(0f, 0f, 0.1, -99999999.0, 99999999.0);
         this.Scale        = new ScaleValue(1f, 1f, 0.1, -99999999.0, 99999999.0);
         PointF anchorPointInPoints = this.CSCom.GetAnchorPointInPoints();
         this.Position = new PointF(left + anchorPointInPoints.X, bottom + anchorPointInPoints.Y);
     }
 }