示例#1
0
 def test_zoomZeroEven(self):
     topLeft = [256, 512]
     tileOffset, inTileOffsetPx = tileMap.scaleRelativeToGlobal(topLeft, 0)
     self.assertEqual(tileOffset, [1, 2], "tile offset")
     self.assertEqual(inTileOffsetPx, [0, 0], "px offset")
示例#2
0
 def test_zoomOneNegativeRound(self):
     topLeft = [-257, -511]
     tileOffset, inTileOffsetPx = tileMap.scaleRelativeToGlobal(topLeft, 1)
     self.assertEqual(tileOffset, [-3, -4], "tile offset")
     self.assertEqual(inTileOffsetPx, [254, 2], "px offset")
示例#3
0
 def test_zoomOneNegativeEven(self):
     topLeft = [-256, -512]
     tileOffset, inTileOffsetPx = tileMap.scaleRelativeToGlobal(topLeft, 1)
     self.assertEqual(tileOffset, [-2, -4], "tile offset")
     self.assertEqual(inTileOffsetPx, [0, 0], "px offset")
示例#4
0
 def test_zoomOneRound(self):
     topLeft = [257, 520]
     tileOffset, inTileOffsetPx = tileMap.scaleRelativeToGlobal(topLeft, 1)
     self.assertEqual(tileOffset, [2, 4], "tile offset")
     self.assertEqual(inTileOffsetPx, [2, 16], "px offset")
示例#5
0
 def test_zoomZeroNegativeRound(self):
     topLeft = [-257, -511]
     tileOffset, inTileOffsetPx = tileMap.scaleRelativeToGlobal(topLeft, 0)
     self.assertEqual(tileOffset, [-2, -2], "tile offset")
     self.assertEqual(inTileOffsetPx, [255, 1], "px offset")
示例#6
0
 def test_zoomZeroRound(self):
     topLeft = [257, 520]
     tileOffset, inTileOffsetPx = tileMap.scaleRelativeToGlobal(topLeft, 0)
     self.assertEqual(tileOffset, [1, 2], "tile offset")
     self.assertEqual(inTileOffsetPx, [1, 8], "px offset")