mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-31 18:18:02 +01:00
move +3 for descenders to termHeightFromRows
This commit is contained in:
parent
082fe4a425
commit
c0de69e4a2
@ -153,8 +153,7 @@ class TerminalRenderer extends React.Component<
|
||||
.get();
|
||||
let cmd = screen.getCmd(line); // will not be null
|
||||
let usedRows = screen.getUsedRows(lineutil.getRendererContext(line), line, cmd, width);
|
||||
// TODO: replace the +2 with some calculation based on termFontSize. the +2 is for descenders, which get cut off without this.
|
||||
let termHeight = termHeightFromRows(usedRows, GlobalModel.termFontSize.get()) + 2;
|
||||
let termHeight = termHeightFromRows(usedRows, GlobalModel.termFontSize.get());
|
||||
if (usedRows === 0) {
|
||||
termHeight = 0;
|
||||
}
|
||||
|
@ -83,7 +83,8 @@ function termWidthFromCols(cols: number, fontSize: number): number {
|
||||
|
||||
function termHeightFromRows(rows: number, fontSize: number): number {
|
||||
let dr = getMonoFontSize(fontSize);
|
||||
return Math.ceil(dr.height * rows);
|
||||
// TODO: replace the +3 with some calculation based on termFontSize. the +3 is for descenders, which get cut off without this.
|
||||
return Math.ceil(dr.height * rows) + 3;
|
||||
}
|
||||
|
||||
export { measureText, getMonoFontSize, windowWidthToCols, windowHeightToRows, termWidthFromCols, termHeightFromRows };
|
||||
|
Loading…
Reference in New Issue
Block a user