Skip to content

Commit

Permalink
[contour] TerminalDisplay: pixelSize() now returns the terminal displ…
Browse files Browse the repository at this point in the history
…ay size including its configured visual margin

Signed-off-by: Christian Parpart <[email protected]>
  • Loading branch information
christianparpart committed Dec 28, 2024
1 parent 2f3e78a commit 83b033b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/contour/display/TerminalDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,11 @@ bool TerminalDisplay::isFullScreen() const
vtbackend::ImageSize TerminalDisplay::pixelSize() const
{
assert(_session);
return gridMetrics().cellSize * _session->terminal().pageSize();
auto const scaledWindowMargins = applyContentScale(_session->profile().margins.value(), contentScale());
auto const scaledWindowMarginsPixels =
vtbackend::ImageSize { Width::cast_from(unbox(scaledWindowMargins.horizontal) * 2),
Height::cast_from(unbox(scaledWindowMargins.vertical) * 2) };
return gridMetrics().cellSize * _session->terminal().pageSize() + scaledWindowMarginsPixels;
}

vtbackend::ImageSize TerminalDisplay::cellSize() const
Expand Down

0 comments on commit 83b033b

Please sign in to comment.