now rollRibbon supports extend param, still untested...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-11-25 04:27:20 +04:00
parent 0b2b58878a
commit 5788cb1b9b
2 changed files with 5 additions and 7 deletions

View File

@ -468,8 +468,12 @@ function extendRibbon(left, right, ribbon, no_compensate_shift){
// NOTE: if n is negative the ribbon will be rolled right.
// NOTE: rollRibbon(N, R) is equivalent to extendRibbon(-N, N, R)
// NOTE: this will return a single list of relocated elements...
// NOTE: if extend is non-zero the extension will happen ONLY in the
// direction of the roll...
function rollRibbon(n, ribbon, extend, no_compensate_shift){
var res = extendRibbon(-n, n, ribbon, no_compensate_shift)
var l = extend == null || n >= 0 ? 0 : extend
var r = extend == null || n < 0 ? 0 : extend
var res = extendRibbon(-n-l, n+r, ribbon, no_compensate_shift)
return n > 0 ? res.right : res.left
}

View File

@ -118,12 +118,6 @@ function setupDataBindings(viewer){
// ...might also be a good idea to load smaller images
// while scrolling really fast...
// XXX use extendRibbon, to both roll and expand/contract...
// XXX BUG: when rolling a ribbon, this will sometimes
// misalign an image...
// ...where exactly this happens in the ribbon depends on
// its size and LOAD_SCREENS...
// NOTE: calling centerView() will fix this.
// ...the problem is in centerRibbon
if(tail.length < threshold){
var rolled = rollImages(frame_size, ribbon)
}