// Translate a vertical drag offset (px) into an integer row-delta,
// given the measured row height (px). Used by QueueTrackRow when a
// neodrag drop completes — we round to the nearest row boundary so
// the user's drop intent maps to a clean queue index.
export function offsetToDelta(offsetY: number, rowHeight: number): number {
  if (rowHeight <= 0) return 0;
  // `|| 0` normalizes -0 to +0. Math.round(-0.5) === -0; downstream
  // consumers (and Object.is in tests) treat -0 and +0 as distinct.
  return Math.round(offsetY / rowHeight) || 0;
}
