Просмотр исходного кода

fix(channels): draw signal gridlines downward from the first multiple of 10 (#1254)

Tick loop direction fix. #1214
Nacho 2 месяцев назад
Родитель
Сommit
baab56f343
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      app/src/components/channels/ChannelSpectrum.tsx

+ 1 - 2
app/src/components/channels/ChannelSpectrum.tsx

@@ -225,8 +225,7 @@ export function ChannelSpectrum({
       }
       }
 
 
       // Rejilla de señal: múltiplos de 10 dentro del rango real de la vista.
       // Rejilla de señal: múltiplos de 10 dentro del rango real de la vista.
-      const tickStart = Math.ceil(topDbm / 10) * 10
-      for (let d = tickStart; d <= botDbm + 1; d += 10) {
+      for (let d = Math.floor(topDbm / 10) * 10; d >= botDbm; d -= 10) {
         g.strokeStyle = colors.border
         g.strokeStyle = colors.border
         g.lineWidth = 1
         g.lineWidth = 1
         g.beginPath()
         g.beginPath()