@@ -177,8 +177,7 @@ export function LogLine({
|
||||
|
||||
useEffect(() => {
|
||||
if (lineRef.current && setRowHeight) {
|
||||
// lineNumber is 1-based but height index is 0-based
|
||||
setRowHeight(line.lineNumber - 1, lineRef.current.offsetHeight);
|
||||
setRowHeight(line.lineNumber, lineRef.current.offsetHeight);
|
||||
}
|
||||
}, [line.lineNumber, setRowHeight]);
|
||||
|
||||
|
||||
@@ -87,7 +87,8 @@ export function RealLogViewer(props: RealLogViewerProps) {
|
||||
function setRowHeight(index: number, size: number) {
|
||||
if (shouldTextWrap && listInstance) {
|
||||
(listInstance as VariableSizeList<AnsiLine[]>).resetAfterIndex(0);
|
||||
heights.current = { ...heights.current, [index]: size };
|
||||
// lineNumber is 1-based but index is 0-based
|
||||
heights.current = { ...heights.current, [index - 1]: size };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user