Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (!(obj is DisplayModel))
            {
                return(false);
            }
            DisplayModel other = (DisplayModel)obj;

            if (this.backgroundColor != other.backgroundColor)
            {
                return(false);
            }
            if (this.fixedTileSize != other.fixedTileSize)
            {
                return(false);
            }
            if (this.maxTextWidth != other.maxTextWidth)
            {
                return(false);
            }
            if (BitConverter.ToInt32(BitConverter.GetBytes(this.maxTextWidthFactor), 0) != BitConverter.ToInt32(BitConverter.GetBytes(other.maxTextWidthFactor), 0))
            {
                return(false);
            }
            if (this.tileSize != other.tileSize)
            {
                return(false);
            }
            if (this.tileSizeMultiple != other.tileSizeMultiple)
            {
                return(false);
            }
            if (BitConverter.ToInt32(BitConverter.GetBytes((this.userScaleFactor)), 0) != BitConverter.ToInt32(BitConverter.GetBytes((other.userScaleFactor)), 0))
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
 public MapViewPosition(DisplayModel displayModel) : base()
 {
     this.displayModel = displayModel;
     this.zoomLevelMax = sbyte.MaxValue;
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void tileSizeTest()
        public virtual void tileSizeTest()
        {
            DisplayModel displayModel = new DisplayModel();

            Assert.assertEquals(256, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(512, displayModel.TileSize);
            displayModel.UserScaleFactor = 1.5f;
            Assert.assertEquals(384, displayModel.TileSize);
            displayModel.TileSizeMultiple = 100;
            Assert.assertEquals(400, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(500, displayModel.TileSize);
            displayModel.TileSizeMultiple = 64;
            Assert.assertEquals(512, displayModel.TileSize);

            DisplayModel.DeviceScaleFactor = 2;
            displayModel.UserScaleFactor   = 1;
            displayModel.TileSizeMultiple  = 1;

            Assert.assertEquals(512, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(1024, displayModel.TileSize);
            displayModel.UserScaleFactor = 1.5f;
            Assert.assertEquals(768, displayModel.TileSize);
            displayModel.TileSizeMultiple = 100;
            Assert.assertEquals(800, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(1000, displayModel.TileSize);
            displayModel.TileSizeMultiple = 64;
            Assert.assertEquals(1024, displayModel.TileSize);

            DisplayModel.DeviceScaleFactor = 1;
            displayModel.UserScaleFactor   = 1;
            displayModel.TileSizeMultiple  = 1;

            Assert.assertEquals(256, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(512, displayModel.TileSize);
            displayModel.UserScaleFactor = 1.5f;
            Assert.assertEquals(384, displayModel.TileSize);
            displayModel.TileSizeMultiple = 100;
            Assert.assertEquals(400, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(500, displayModel.TileSize);
            displayModel.TileSizeMultiple = 64;
            Assert.assertEquals(512, displayModel.TileSize);

            DisplayModel.DeviceScaleFactor = 1.2f;
            displayModel.UserScaleFactor   = 1;
            displayModel.TileSizeMultiple  = 1;

            Assert.assertEquals(307, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(614, displayModel.TileSize);
            displayModel.UserScaleFactor = 1.5f;
            Assert.assertEquals(461, displayModel.TileSize);
            displayModel.TileSizeMultiple = 100;
            Assert.assertEquals(500, displayModel.TileSize);
            displayModel.UserScaleFactor = 2;
            Assert.assertEquals(600, displayModel.TileSize);
            displayModel.TileSizeMultiple = 64;
            Assert.assertEquals(640, displayModel.TileSize);
        }