
|
If you were logged in you would be able to see more operations.
|
|
|
| Severity: |
Minor
|
| Runtime: |
N/A
|
| Flags: |
External
|
| Fix in hand: |
True
|
|
Within the method "setTarget(..)" of basefocusview, there is bug, which will cause umlimited registration to the events "onwidth" and "onheight" of the canvas.
(sourcecode is copied from base/basefocusview.lzx#setTarget(..), l. 184 to l. 197 )
As you can see in the sourcecode, after the while-loop the variable "p" will have the value "canvas"
_______________________________________
var p = newtarget;
var i = 0;
while ( p != canvas ) {
this._xydelegate.register(p, 'onx');
this._xydelegate.register(p, 'ony');
p = p.immediateparent;
i++;
}
_______________________________________
Now we create new LzDelegates...
_______________________________________
if ( !this._widthdel ) this._widthdel = new LzDelegate(this, "followWidth");
if ( !this._heightdel ) this._heightdel = new LzDelegate(this, "followHeight");
_______________________________________
And now we will register the delegates to the events "onwidth" and "onheight" of the canvas (as p==canvas, see above!).
This will happen everytime we pass this part of the method, so everytime we invoke setTarget(..).
_______________________________________
this._widthdel.register(p,'onwidth');
this._heightdel.register(p,'onheight');
_______________________________________
--------------------------------------------------------------------
To stop this unwanted behaviour change the source like so (l.193 to l.197):
_______________________________________
if ( !this._widthdel ) {
this._widthdel = new LzDelegate(this, "followWidth");
this._widthdel.register(canvas,'onwidth');
}
if ( !this._heightdel ) {
this._heightdel = new LzDelegate(this, "followHeight");
this._heightdel.register(canvas,'onheight');
}
_______________________________________
|
|
Description
|
Within the method "setTarget(..)" of basefocusview, there is bug, which will cause umlimited registration to the events "onwidth" and "onheight" of the canvas.
(sourcecode is copied from base/basefocusview.lzx#setTarget(..), l. 184 to l. 197 )
As you can see in the sourcecode, after the while-loop the variable "p" will have the value "canvas"
_______________________________________
var p = newtarget;
var i = 0;
while ( p != canvas ) {
this._xydelegate.register(p, 'onx');
this._xydelegate.register(p, 'ony');
p = p.immediateparent;
i++;
}
_______________________________________
Now we create new LzDelegates...
_______________________________________
if ( !this._widthdel ) this._widthdel = new LzDelegate(this, "followWidth");
if ( !this._heightdel ) this._heightdel = new LzDelegate(this, "followHeight");
_______________________________________
And now we will register the delegates to the events "onwidth" and "onheight" of the canvas (as p==canvas, see above!).
This will happen everytime we pass this part of the method, so everytime we invoke setTarget(..).
_______________________________________
this._widthdel.register(p,'onwidth');
this._heightdel.register(p,'onheight');
_______________________________________
--------------------------------------------------------------------
To stop this unwanted behaviour change the source like so (l.193 to l.197):
_______________________________________
if ( !this._widthdel ) {
this._widthdel = new LzDelegate(this, "followWidth");
this._widthdel.register(canvas,'onwidth');
}
if ( !this._heightdel ) {
this._heightdel = new LzDelegate(this, "followHeight");
this._heightdel.register(canvas,'onheight');
}
_______________________________________ |
Show » |
|