Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Download on resize

  • Loading branch information...
commit 605702e6b9a6838792a52a109bdfcce6d2de271c 1 parent 0247dab
Richard Fairhurst authored October 18, 2012
1  net/systemeD/halcyon/Map.as
@@ -206,6 +206,7 @@ package net.systemeD.halcyon {
206 206
 			mapwidth = w; centre_lon=coord2lon(-getX()+w/2);
207 207
 			mapheight= h; centre_lat=coord2lat(-getY()+h/2);
208 208
 			setScrollRectSize(w,h);
  209
+			updateCoords(getX(),getY());
209 210
 
210 211
 			this.dispatchEvent(new MapEvent(MapEvent.RESIZE, {width:w, height:h}));
211 212
 			
16  potlatch2.mxml
@@ -137,6 +137,7 @@
137 137
 		private var saveLabel:String='Save';
138 138
 		private var saveTimer:Timer;
139 139
 		private var mouseTimer:Timer;
  140
+		private var resizeTimer:Timer;
140 141
 
141 142
         include "version.as";
142 143
 
@@ -420,14 +421,25 @@
420 421
 		}
421 422
 
422 423
         public function onResizeMap():void {
423  
-            if ( theMap != null )
424  
-                theMap.updateSize(map_area.width, map_area.height);
  424
+			if (!theMap) return;
  425
+			theMap.updateSize(map_area.width, map_area.height);
425 426
 
426 427
 			if (toolbox) {
427 428
 				toolbox.x=Math.min(toolbox.x,suggestToolboxX());
428 429
 				toolbox.y=Math.min(toolbox.y,suggestToolboxY());
429 430
 			}
  431
+
  432
+			if (!resizeTimer) {
  433
+				resizeTimer=new Timer(300);
  434
+				resizeTimer.addEventListener(TimerEvent.TIMER, resizeMapEnd, false, 0, true);
  435
+			}
  436
+			resizeTimer.reset();
  437
+			resizeTimer.start();
430 438
         }
  439
+		private function resizeMapEnd(e:Event):void {
  440
+			resizeTimer.stop();
  441
+			theMap.download();
  442
+		}
431 443
 		private function bumpHandler(e:MapEvent):void {
432 444
 			if (toolbox) { 
433 445
 				toolbox.y=Math.min(toolbox.y,suggestToolboxY(e.params.y+5));

0 notes on commit 605702e

Please sign in to comment.
Something went wrong with that request. Please try again.