From 5788cb1b9b65210c16c4b33df5b829c487eb1763 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 25 Nov 2013 04:27:20 +0400 Subject: [PATCH] now rollRibbon supports extend param, still untested... Signed-off-by: Alex A. Naanou --- ui/ribbons.js | 6 +++++- ui/setup.js | 6 ------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ui/ribbons.js b/ui/ribbons.js index c64c45fe..d494f6c6 100755 --- a/ui/ribbons.js +++ b/ui/ribbons.js @@ -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 } diff --git a/ui/setup.js b/ui/setup.js index c72d9608..3cb66282 100755 --- a/ui/setup.js +++ b/ui/setup.js @@ -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) }