Commits

Anonymous committed 41936a2

Un hardcoding the Stage x/y/pivot.

  • Participants
  • Parent commits bdcb15b

Comments (0)

Files changed (2)

File web/src/map/input_handling.dart

     if(jMouse._scrollDY < 0.0) {
       Point mouse = new Point(jMouse.X, jMouse.Y);
       mapContainer.terrainLayer.modScale(mouse, 0.035);
+      movedThisFrame = true;
     } else if(jMouse._scrollDY > 0.0) {
       Point mouse = new Point(jMouse.X, jMouse.Y);
       mapContainer.terrainLayer.modScale(mouse, -0.035);
+      movedThisFrame = true;
     }
 
     jMouse.resetAccumulator();

File web/src/map/map_container.dart

   int hexesWide;
   int hexesTall;
 
+  // TODO: Move this to the map data layer.
   List<List> hexElevations;
   List<List> hexTerrain;
   Map terrainNames;
   HexMapDataManager dataManager;
 
   MapContainer() {
-    x = 400.0;
-    y = 300.0;
-    pivotX = 400.0;
-    pivotY = 300.0;
-
-    /*
-    print("hexSize ${hexSize}");
-    print("hexPixelHeight ${hexPixelHeight}");
-    print("vertOffset ${vertOffset}");
-    print("hexPixelWidth ${hexPixelWidth}");
-    print("horizOffset ${horizOffset}");
-    */
-
+    x = pivotX = stage.contentRectangle.width / 2.0;
+    y = pivotY = stage.contentRectangle.height / 2.0;
 
     // Retrieves and sets the hexElevations/hexTerrain and other instance
     // attribs that rely on remote data.
     terrainLayer = new TerrainLayerSprite(this);
     keyboardInputHandler = new HexMapKeyboardInputHandler(this);
     mouseInputHandler = new HexMapMouseInputHandler(this);
-    print("Stage Content Rectangle: ${stage.contentRectangle}");
   }
 
   /**