more refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-11-25 05:22:31 +04:00
parent 8385ba422a
commit ef2bc3c38c

View File

@ -1261,7 +1261,7 @@ function updateImages(size){
// XXX Race condition: when this is called while DATA is not yet fully // XXX Race condition: when this is called while DATA is not yet fully
// loaded (old data), the from gid will not be present in // loaded (old data), the from gid will not be present in
// DATA.ribbons... // DATA.ribbons...
function getGIDsAfter(from, count, ribbon, inclusive){ function getGIDsAfter(count, from, ribbon, inclusive){
if(count == 0){ if(count == 0){
return [] return []
} }
@ -1490,7 +1490,7 @@ function rollImages(n, ribbon, extend, no_compensate_shift){
var from = n > 0 ? getImageGID(ribbon.find('.image').last()) var from = n > 0 ? getImageGID(ribbon.find('.image').last())
: getImageGID(ribbon.find('.image').first()) : getImageGID(ribbon.find('.image').first())
var gids = getGIDsAfter(from, n, r) var gids = getGIDsAfter(n, from, r)
if(gids.length == 0){ if(gids.length == 0){
return $([]) return $([])
} }
@ -1588,8 +1588,8 @@ function preCacheRibbonImages(ribbon){
var first = getImageGID(images.first()) var first = getImageGID(images.first())
var last = getImageGID(images.last()) var last = getImageGID(images.last())
var gids = getGIDsAfter(first, -cache_frame_size) var gids = getGIDsAfter(-cache_frame_size, first)
.concat(getGIDsAfter(last, cache_frame_size)) .concat(getGIDsAfter(cache_frame_size, last))
var cache = [] var cache = []
IMAGE_CACHE[i] = cache IMAGE_CACHE[i] = cache