alexvoz / as3isolib

Automatically exported from code.google.com/p/as3isolib
0 stars 0 forks source link

IsoView.rangeOfMotionTarget does not respect currentZoom #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set the limitRangeOfMotion and rangeOfMotionTarget properties of the IsoView 
to a large iso object, such as a grid. Add UI elements to enable zooming and 
panning of the iso view.
2. Pan to the edge of the object in the IsoView, works correctly.
3. Zoom the IsoView and then try panning again, unexpected behaviour.

What is the expected output? What do you see instead?
That the viewable area would be locked to only display the object used for the 
rangeOfMotionTarget, taking into account the zoom of the iso view.

Instead, when zoomed in we can pan too far past the object. The inverse may be 
true too when zooming out.

What version of the product are you using? On what operating system?
Revision 306 on OSX 10.5.8

Please provide any additional information below.
Great library, thank you!

Original issue reported on code.google.com by benjamin...@gmail.com on 5 Aug 2010 at 3:39

GoogleCodeExporter commented 9 years ago
Facing exact same problem. :(

Original comment by shahr...@riseuplabs.com on 15 Aug 2011 at 11:53

GoogleCodeExporter commented 9 years ago
what i do to work around this issue is force the view to pan to (0,0) before 
applying zoom. like this (pseudo code):

var intendedzoomlevel 

override zoom(zfactor){
   intendedzoomlevel = zfactor
   //wait until the render phase triggered by panTo() is complete 
   this.addEventListener(IsoEvent.RENDER_COMPLETE, doZoom);
   //pan first
   panTo(0,0)
}

doZoom(){
   removeEventListener(IsoEvent.RENDER_COMPLETE, doZoom);
   super.zoom(intendedzoomlevel);
}

Original comment by mas...@masputih.com on 27 Oct 2011 at 7:12