UI: Fix current line number in telemetry overview window

This commit is contained in:
Shreya Malviya 2022-04-21 12:58:18 +05:30
parent d1ac07b7a4
commit bb238de037
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ const TelemetryLog = (props: { onStatusChange: Function }) => {
let telemetryLineHeight = parseInt((telemetryStyle.lineHeight).replace('px', ''));
setIsScrolledUp((element.scrollTop < scrollTop));
setTelemetryCurrentLine(Math.trunc(element.scrollTop / telemetryLineHeight) + 1);
// Zooming in or out doesn't change the number of lines that are visible at once i.e. 5.
setTelemetryCurrentLine(Math.trunc(element.scrollTop / telemetryLineHeight) + 5);
setTelemetryLines(Math.trunc(element.scrollHeight / telemetryLineHeight));
}