Shift-zoom to go in/out by 3 levels
authorRichard Fairhurst <richard@systemeD.net>
Sun, 26 Feb 2017 20:21:47 +0000 (20:21 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Sun, 26 Feb 2017 20:21:47 +0000 (20:21 +0000)
net/systemeD/halcyon/Map.as
potlatch2.mxml

index 779a1e4..f45a2c9 100644 (file)
@@ -329,12 +329,12 @@ package net.systemeD.halcyon {
                                getLayerAt(i).redrawPOIs();
                }
                
-               public function zoomIn():void {
-                       if (scale!=MAXSCALE) changeScale(scale+1);
+               public function zoomIn(increment:uint=1):void {
+                       changeScale(Math.min(scale+increment, MAXSCALE));
                }
 
-               public function zoomOut():void {
-                       if (scale!=MINSCALE_TILES) changeScale(scale-1);
+               public function zoomOut(increment:uint=1):void {
+                       changeScale(Math.max(scale-increment, MINSCALE_TILES));
                }
                
                public function setScale(newscale:uint):void {
index ad5f6c9..afa70f0 100644 (file)
@@ -78,9 +78,9 @@
             <mx:Canvas id="map_area" resize="onResizeMap()"
                 top="0" left="0" width="100%" height="100%" dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);">
             </mx:Canvas>
-            <mx:Image source="@Embed('embedded/zoomIn.svg')" left="5" top="5" click="theMap.zoomIn();"
+            <mx:Image source="@Embed('embedded/zoomIn.svg')" left="5" top="5" click="theMap.zoomIn(event.shiftKey ? 3 : 1);"
                 rollOverEffect="glowImage" rollOutEffect="unglowImage" toolTip="{'Zoom in - currently z'+getScale()}" />
-            <mx:Image source="@Embed('embedded/zoomOut.svg')" left="5" top="22" click="theMap.zoomOut();"
+            <mx:Image source="@Embed('embedded/zoomOut.svg')" left="5" top="22" click="theMap.zoomOut(event.shiftKey ? 3 : 1);"
                 rollOverEffect="glowImage" rollOutEffect="unglowImage" toolTip="{'Zoom out - currently z'+getScale()}" />
             <mx:Image source="@Embed('embedded/search.svg')" left="5" top="42" click="new FindDialog().init();"
                 rollOverEffect="glowImage" rollOutEffect="unglowImage" toolTip="Find place" />