mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-19 17:51:41 +00:00
now rollRibbon supports extend param, still untested...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
0b2b58878a
commit
5788cb1b9b
@ -468,8 +468,12 @@ function extendRibbon(left, right, ribbon, no_compensate_shift){
|
|||||||
// NOTE: if n is negative the ribbon will be rolled right.
|
// NOTE: if n is negative the ribbon will be rolled right.
|
||||||
// NOTE: rollRibbon(N, R) is equivalent to extendRibbon(-N, N, R)
|
// NOTE: rollRibbon(N, R) is equivalent to extendRibbon(-N, N, R)
|
||||||
// NOTE: this will return a single list of relocated elements...
|
// 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){
|
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
|
return n > 0 ? res.right : res.left
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -118,12 +118,6 @@ function setupDataBindings(viewer){
|
|||||||
// ...might also be a good idea to load smaller images
|
// ...might also be a good idea to load smaller images
|
||||||
// while scrolling really fast...
|
// while scrolling really fast...
|
||||||
// XXX use extendRibbon, to both roll and expand/contract...
|
// 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){
|
if(tail.length < threshold){
|
||||||
var rolled = rollImages(frame_size, ribbon)
|
var rolled = rollImages(frame_size, ribbon)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user