Example #1
0
 public void PolygonAlignToPivotTest()
 {
     var startPnts = new[] { 
           new PointF(0 , 0)
         , new PointF(20, 30)
         , new PointF(40, 0) };
     var plg = new Polygon(startPnts);
     var newPivot = plg.GetCenter();
     if (!newPivot.IsEmpty)
         using (plg.UsingUpdate())
             plg.Location = new PointF(plg.Location.X - newPivot.X, plg.Location.Y - newPivot.Y);
     var controlPnts = new[] { 
           new PointF(-20 , -10)
         , new PointF(0, 20)
         , new PointF(20, -10) };
     foreach (var i in plg.Keys)
         Assert.IsTrue(controlPnts[i].Equals(plg[i]));
 }