History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-2895
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P2 P2
Assignee: Mamye Kratt
Reporter: André Bargull
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

basefocusview registers itself umlimited to canvas-events

Created: 08/Oct/06 04:18 PM   Updated: 21/Feb/07 05:16 PM
Component/s: Components - base
Affects Version/s: 3.3.3
Fix Version/s: 4.0.0

Time Tracking:
Not Specified

Severity: Minor
Runtime: N/A
Flags: External
Fix in hand: True


 Description  « Hide
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');
  }
_______________________________________

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jim Grandy - 29/Jan/07 09:30 PM
Please verify contributor's agreement and then propose for OL4 inclusion.

Josh Crowley - 07/Feb/07 12:12 AM
Agreement received for this contributor. Forwarded to Rebecca.

Trying to work out a good test case for this.

Josh Crowley - 21/Feb/07 05:16 PM
Approved by Tucker with a mild alteration.