Hi,

I've come across a small but annoying bug in the groupmanager...

In groupmanager.js, there is a function called "_NewSetLocation" which is used to override the DynLayers "setLocation" function. "setLocation" is called from DynLayer.setX like so:
p.setX=function(x) {this.setLocation(x,null)};
i.e. with one argument set to null.


When setX() or setY() is called on a layer that is managed by the groupmanager, the groupmanagers NewSetLocation function tries to calculate how far the layer has moved :
GroupManager._NewSetLocation = function(x,y){
var byX=x-this.x;
var byY=y-this.y;
So, if you call setX(), it will calculate the byX value correctly but will set the byY value to "-this.y". This has the effect of setting the x-coord of the layer to what you want and setting the y-coord to 0! A few tests to see int the x or y values are null seems to fix things up nicely.


A fixed version is:
   GroupManager._NewSetLocation = function(x,y){
        var byX=0,byY=0;
        if(x!=null) byX=x-this.x;
        if(y!=null) byY=y-this.y;


Andrew.





-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to