@waveform-playlist/ui-components 15.0.0-next.7 → 15.0.0-next.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2996,10 +2996,9 @@ var SmartScale = ({
2996
2996
  const { marker, bigStep, smallStep } = config;
2997
2997
  const canvasInfo = /* @__PURE__ */ new Map();
2998
2998
  const labels = [];
2999
- const pixPerSec = sampleRate / samplesPerPixel;
3000
- let counter = 0;
3001
- for (let i = 0; i < widthX; i += pixPerSec * smallStep / 1e3) {
3002
- const pix = Math.floor(i);
2999
+ for (let counter = 0; ; counter += smallStep) {
3000
+ const pix = Math.floor(counter * sampleRate / (1e3 * samplesPerPixel));
3001
+ if (!(pix < widthX)) break;
3003
3002
  if (counter % marker === 0) {
3004
3003
  labels.push({
3005
3004
  id: `timestamp-${counter}`,
@@ -3013,7 +3012,6 @@ var SmartScale = ({
3013
3012
  } else if (counter % smallStep === 0) {
3014
3013
  canvasInfo.set(pix, Math.floor(timeScaleHeight / 5));
3015
3014
  }
3016
- counter += smallStep;
3017
3015
  }
3018
3016
  return { widthX, canvasInfo, labels };
3019
3017
  }, [beatsAndBars, duration, samplesPerPixel, sampleRate, timeScaleHeight]);