public void PanThroughDatelineNormalisesView() { DatelineCrossingMap map = new DatelineCrossingMap(); map.Size = new Size(100, 100); map.ViewExtents = new Extent(155, -10, 175, 10); map.MapFrame.Pan(new Point(150, 0)); Assert.AreEqual(new Extent(-175, -10, -155, 10), map.MapFrame.ViewExtents, "main frame panned into west"); Assert.AreEqual(new Rectangle(0, 0, 100, 100), ((MapFrame) map.MapFrame).ClipRectangle, "main frame shows the whole view"); }
public void PanThroughDatelineNormalisesView() { DatelineCrossingMap map = new DatelineCrossingMap(); map.Size = new Size(100, 100); map.ViewExtents = new Extent(155, -10, 175, 10); map.MapFrame.Pan(new Point(150, 0)); Assert.AreEqual(new Extent(-175, -10, -155, 10), map.MapFrame.ViewExtents, "main frame panned into west"); Assert.AreEqual(new Rectangle(0, 0, 100, 100), ((MapFrame)map.MapFrame).ClipRectangle, "main frame shows the whole view"); }
public void PanRightAcrossDatelineShowsTwoViews() { DatelineCrossingMap map = new DatelineCrossingMap(); map.Size = new Size(100, 100); map.ViewExtents = new Extent(155, -10, 175, 10); Assert.AreEqual(new Extent(155, -10, 175, 10), map.ViewExtents, "Set view has not been changed for aspect ratio"); map.MapFrame.Pan(new Point(50, 0)); Assert.AreEqual(new Extent(165, -10, 185, 10), map.MapFrame.ViewExtents, "main frame panned"); Assert.AreEqual(new Extent(-195, -10, -175, 10), map.SecondaryMapFrame.ViewExtents, "secondary frame takes up the slack"); Assert.AreEqual(new Rectangle(0, 0, 75, 100), ((MapFrame) map.MapFrame).ClipRectangle, "main frame shows on the left"); Assert.AreEqual(new Rectangle(75, 0, 25, 100), ((MapFrame) map.SecondaryMapFrame).ClipRectangle, "secondary frame shows on the right"); }
public void PanRightAcrossDatelineShowsTwoViews() { DatelineCrossingMap map = new DatelineCrossingMap(); map.Size = new Size(100, 100); map.ViewExtents = new Extent(155, -10, 175, 10); Assert.AreEqual(new Extent(155, -10, 175, 10), map.ViewExtents, "Set view has not been changed for aspect ratio"); map.MapFrame.Pan(new Point(50, 0)); Assert.AreEqual(new Extent(165, -10, 185, 10), map.MapFrame.ViewExtents, "main frame panned"); Assert.AreEqual(new Extent(-195, -10, -175, 10), map.SecondaryMapFrame.ViewExtents, "secondary frame takes up the slack"); Assert.AreEqual(new Rectangle(0, 0, 75, 100), ((MapFrame)map.MapFrame).ClipRectangle, "main frame shows on the left"); Assert.AreEqual(new Rectangle(75, 0, 25, 100), ((MapFrame)map.SecondaryMapFrame).ClipRectangle, "secondary frame shows on the right"); }