[Laszlo-dev] explicit replicator bug notes
Henry Minsky
henry.minsky at gmail.com
Thu Sep 6 21:13:21 PDT 2007
I was poking at the lazy explicit replicator bug (LPP-4666) and
noticed the following two issues:
[1] I noticed in a backtrace that _adjustVisibleClones is getting called
recursively, which doesn't seem like a good idea, as views get inserted in the
wrong order somehow.
I tried doing this, commenting out the explicit call to
__adjustVisibleClones in replicator.setNodes:
function setNodes (n) {
this.nodes = n;
//this.__adjustVisibleClones();
this.setAttribute("replicatedsize", this.clones.length == 0
? 0
:
this.clones[this.clones.length-1][this._sizes[this.axis]]);
if (this.onnodes.ready) { this.onnodes.sendEvent(); }
}
I figured that __adjustVisibleClones would get called later anyway,
and it does, and the cloned views come in in the proper order for some
reason. It gets called twice, once with clones list of zero length,
and once with a length of 7, which seems to do the right thing.
Here's the backtrace of it getting called I think from an ony event
from a scrollbar after canvas init.
«Backtrace(15)#199| __adjustVisibleClones <- sendEvent <- setY <-
setAttribute <- _showEnabl...» {
length: 15
0: kernel/LzIdleKernel.lzs#29/16 @lfc/kernel/LzIdleKernel.lzs#32
1: __idleupdate @lfc/services/LzIdle.lzs#103
2: sendEvent @lfc/events/LaszloEvents.lzs#437
3: checkQ @lfc/services/LzInstantiator.lzs#152
4: makeSomeViews @lfc/services/LzInstantiator.lzs#212
5: __LZinstantiationDone @lfc/views/LaszloCanvas.lzs#422
6: okToInit @lfc/views/LaszloCanvas.lzs#431
7: __LZcallInit @lfc/views/LaszloCanvas.lzs#491
8: sendEvent @lfc/events/LaszloEvents.lzs#437
9: _showEnabled @lz/vscrollbar.lzx#-1
10: _showEnabled @base/basescrollbar.lzx#345
11: setAttribute @lfc/core/LzNode.lzs#911
12: setY @lfc/views/LaszloView.lzs#1334
13: sendEvent @lfc/events/LaszloEvents.lzs#437
14: __adjustVisibleClones @utils/replicator/lazyreplicator.lzx#52
}«Backtrace(15)#199| __adjustVisibleClones <- sendEvent <- setY <-
setAttribute <- _showEnabl...»
lzx>
[2] But scrolling is still screwed up, if you scroll gaps appear, and
scrolling back
things come in in random order more or less.
+ Looking at the subviews array and clones list, there are the right
number of clones, with the right bindings for the most part, but
they seem to have the wrong Y positions, so they cannot be seen.
+ There is a reference in adjustvisibleClones to "this.totalsize", but
nobody is computing this.totalsize?
Probably the y offset calculations are just wrong.
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
More information about the Laszlo-dev
mailing list