separate channel byte markers
This commit is contained in:
21
index.js
21
index.js
@@ -1063,20 +1063,23 @@ function drawChannelData() {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(channelIndex % 8 === 0) {
|
|
||||||
ctx.strokeStyle = 'black';
|
|
||||||
ctx.lineWidth = 3;
|
|
||||||
ctx.beginPath();
|
|
||||||
ctx.moveTo(0, top-1);
|
|
||||||
ctx.lineTo(width, top-1);
|
|
||||||
ctx.stroke();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
drawChannelByteMarkers(ctx, channelCount, channelHeight, width);
|
||||||
overlays.forEach(fn => fn());
|
overlays.forEach(fn => fn());
|
||||||
drawChannelNumbers(ctx, channelCount, channelHeight)
|
drawChannelNumbers(ctx, channelCount, channelHeight)
|
||||||
console.log('time', performance.now() - S);
|
console.log('time', performance.now() - S);
|
||||||
}
|
}
|
||||||
|
function drawChannelByteMarkers(ctx, channelCount, channelHeight, width) {
|
||||||
|
for(let channelIndex = 8; channelIndex < channelCount; channelIndex+= 8) {
|
||||||
|
let top = channelHeight * channelIndex;
|
||||||
|
ctx.strokeStyle = 'black';
|
||||||
|
ctx.lineWidth = 3;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(0, top);
|
||||||
|
ctx.lineTo(width, top);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
}
|
||||||
function drawChannelNumbers(ctx, channelCount, channelHeight) {
|
function drawChannelNumbers(ctx, channelCount, channelHeight) {
|
||||||
let fontHeight = Math.min(24, channelHeight);
|
let fontHeight = Math.min(24, channelHeight);
|
||||||
ctx.font = `${fontHeight}px Arial`;
|
ctx.font = `${fontHeight}px Arial`;
|
||||||
|
|||||||
Reference in New Issue
Block a user