예제 #1
0
        public void DD_trim()
        {
            var dd = new DisplayData();
            var p1 = new System.Drawing.PointF(-10, -10);

            dd.Add(p1);
            dd.Add(new System.Drawing.PointF(10, 10));

            dd.Add(new System.Drawing.PointF(1, 2));
            dd.Add(new System.Drawing.PointF(4, 3));
            var p2 = new System.Drawing.PointF(5, 5);

            dd.Add(p2);
            var r       = new System.Drawing.RectangleF((float)-5.5, (float)-5.5, 11, 11);
            var trimmed = dd.TrimToWindow(r);

            Assert.AreEqual(3, trimmed.Count);
            Assert.IsFalse(trimmed.Contains(p1));
        }