Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Download on resize

  • Loading branch information...
commit 605702e6b9a6838792a52a109bdfcce6d2de271c 1 parent 0247dab
@systemed authored
Showing with 15 additions and 2 deletions.
  1. +1 −0  net/systemeD/halcyon/Map.as
  2. +14 −2 potlatch2.mxml
View
1  net/systemeD/halcyon/Map.as
@@ -206,6 +206,7 @@ package net.systemeD.halcyon {
mapwidth = w; centre_lon=coord2lon(-getX()+w/2);
mapheight= h; centre_lat=coord2lat(-getY()+h/2);
setScrollRectSize(w,h);
+ updateCoords(getX(),getY());
this.dispatchEvent(new MapEvent(MapEvent.RESIZE, {width:w, height:h}));
View
16 potlatch2.mxml
@@ -137,6 +137,7 @@
private var saveLabel:String='Save';
private var saveTimer:Timer;
private var mouseTimer:Timer;
+ private var resizeTimer:Timer;
include "version.as";
@@ -420,14 +421,25 @@
}
public function onResizeMap():void {
- if ( theMap != null )
- theMap.updateSize(map_area.width, map_area.height);
+ if (!theMap) return;
+ theMap.updateSize(map_area.width, map_area.height);
if (toolbox) {
toolbox.x=Math.min(toolbox.x,suggestToolboxX());
toolbox.y=Math.min(toolbox.y,suggestToolboxY());
}
+
+ if (!resizeTimer) {
+ resizeTimer=new Timer(300);
+ resizeTimer.addEventListener(TimerEvent.TIMER, resizeMapEnd, false, 0, true);
+ }
+ resizeTimer.reset();
+ resizeTimer.start();
}
+ private function resizeMapEnd(e:Event):void {
+ resizeTimer.stop();
+ theMap.download();
+ }
private function bumpHandler(e:MapEvent):void {
if (toolbox) {
toolbox.y=Math.min(toolbox.y,suggestToolboxY(e.params.y+5));
Please sign in to comment.
Something went wrong with that request. Please try again.