Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
else {
positionData[count*2 + 2] = npos[0]
positionData[count*2 + 3] = npos[1]
positionData[count*2 + 4] = npos[2]
positionData[count*2 + 5] = npos[3]
}
}
// add stub
else {
positionData[count*2 + 2] = npos[count*2 - 2]
positionData[count*2 + 3] = npos[count*2 - 1]
positionData[count*2 + 4] = npos[count*2 - 2]
positionData[count*2 + 5] = npos[count*2 - 1]
}
state.positionBuffer(float32(positionData))
state.positionFractBuffer(fract32(positionData))
}
if (o.range) {
state.range = o.range
} else if (!state.range) {
state.range = state.bounds
}
if ((o.range || o.positions) && state.count) {
let bounds = state.bounds
let boundsW = bounds[2] - bounds[0],
boundsH = bounds[3] - bounds[1]
let rangeW = state.range[2] - state.range[0],
let positionData = new Float64Array(len * 2)
let colorData = new Uint8Array(len * 4)
let errorData = new Float32Array(len * 4)
groups.forEach((group, i) => {
if (!group) return
let {positions, count, offset, color, errors} = group
if (!count) return
colorData.set(color, offset * 4)
errorData.set(errors, offset * 4)
positionData.set(positions, offset * 2)
})
positionBuffer(float32(positionData))
positionFractBuffer(fract32(positionData))
colorBuffer(colorData)
errorBuffer(errorData)
}
}