Ejemplo n.º 1
0
 private void DisplayForm_MouseWheel(object sender, MouseEventArgs e)
 {
     if (e.Delta < 0)
     {
         handler.AlterZoom(true, translator.ToFixedLocation(e.Location));
     }
     else
     {
         handler.AlterZoom(false, translator.ToFixedLocation(e.Location));
     }
 }
Ejemplo n.º 2
0
        public void PointMapsCorrectly(int X, int Y, long correctX, long correctY)
        {
            var translator = new LocationTranslator(FixedLocation.Zero, new Rectangle(0, 0, 100, 100), 20.0d);

            var location = translator.ToFixedLocation(new Point(X, Y));

            Assert.AreEqual(correctX, location.X);
            Assert.AreEqual(correctY, location.Y);
        }
Ejemplo n.º 3
0
        public void CenterIsZeroLocation()
        {
            var translator = new LocationTranslator(FixedLocation.Zero, new Rectangle(0, 0, 100, 100), 20.0d);

            var location = translator.ToFixedLocation(new Point(50, 50));

            Assert.AreEqual(0, location.X);
            Assert.AreEqual(0, location.Y);
        }