public void Execute() { StageView stage = MainForm.CurrentStage; uint[] selIds = stage.Selection.SelectedIds; foreach (uint id in selIds) { DesignInstance di = stage.InstanceManager[id]; prevConstraint = di.AspectConstraint; di.AspectConstraint = constraint; } stage.Selection.Update(); MainForm.CurrentStage.InvalidateSelection(); }
public void DrawAspectConstraints(Graphics g, Vex.AspectConstraint ac, PointF[] pts) { if (ac != Vex.AspectConstraint.None) { switch (ac) { case Vex.AspectConstraint.Horizontal: g.DrawLine(wideWhitePen, pts[7], pts[3]); g.DrawLine(selfConstraintPen, pts[7], pts[3]); break; case Vex.AspectConstraint.Vertical: g.DrawLine(wideWhitePen, pts[1], pts[5]); g.DrawLine(selfConstraintPen, pts[1], pts[5]); break; case Vex.AspectConstraint.Locked: g.DrawLine(wideWhitePen, pts[0], pts[4]); g.DrawLine(selfConstraintPen, pts[0], pts[4]); break; } } }
public ConstrainAspectCommand(Vex.AspectConstraint constraint) { this.constraint = constraint; }