mirror of
https://github.com/stablyai/orca.git
synced 2026-10-21 16:03:26 +00:00
Subtract one cell-height padding from viewport to prevent bottom row clipping
Math.floor(vpHeight / cellHeight) can produce a row count where the last row's bottom edge aligns exactly with the container boundary, causing it to be partially hidden. Subtracting one cellHeight before dividing guarantees one full row of breathing room. Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -316,7 +316,11 @@ const XTERM_HTML = `<!DOCTYPE html>
|
||||
? containerHeightPx
|
||||
: window.innerHeight;
|
||||
var cols = Math.floor(vpWidth / cellWidth);
|
||||
var rows = Math.max(8, Math.floor(vpHeight / cellHeight));
|
||||
// Why: subtract one cellHeight of padding before dividing, so the
|
||||
// last row never clips against the container's bottom edge. Without
|
||||
// this, Math.floor can produce a row count where the final row's
|
||||
// bottom pixels sit right at or past the visible boundary.
|
||||
var rows = Math.max(8, Math.floor((vpHeight - cellHeight) / cellHeight));
|
||||
notify({ type: 'measure-result', cols: cols, rows: rows });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user