Handle cases where depths appear multiple times

This commit is contained in:
Ian Scott 2015-01-20 15:50:40 -08:00 committed by Ian Scott
parent 44f9982495
commit 7ed7e896e1

View file

@ -46,7 +46,14 @@ function readDepths(bl, display, depths, n_depths, cb)
var visuals = {};
readVisuals(bl, visuals, n_visuals, function()
{
depths[dep] = visuals;
if (dep in depths) {
for (var visual in visuals) {
depths[dep][visual] = visuals[visual];
}
n_depths--;
} else {
depths[dep] = visuals;
}
if (Object.keys(depths).length == n_depths)
cb();
else