I am performing a nudge or an align by iterating through the view's selected nodes and setting each shape's location.
Is there a better way to do this?
(example of nudge left)
if (nDrawingView1.Selection.NodesCount < 1)
return;
NShape LclShape = nDrawingView1.Selection.Nodes[0] as NShape;
if (LclShape != null)
{
foreach (INNode Tmp in nDrawingView1.Selection.Nodes)
{
LclShape = Tmp as NShape;
if (LclShape == null)
continue;
NPointF TargetPoint = new NPointF(LclShape.Location.X - 1, LclShape.Location.Y);
if (TargetPoint.X < 0)
{
TargetPoint = new NPointF(0, LclShape.Location.Y);
}
LclShape.Location = TargetPoint;
}
}