Skip to content

Commit

Permalink
Make padding applied as swap chain panel's margin (microsoft#1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
Summon528 authored and mcpiroman committed Jul 23, 2019
1 parent cf3a0b6 commit c687948
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
uint32_t bg = _settings.DefaultBackground();
_BackgroundColorChanged(bg);

// Apply padding to the root Grid
// Apply padding as swapChainPanel's margin
auto thickness = _ParseThicknessFromPadding(_settings.Padding());
_root.Padding(thickness);
_swapChainPanel.Margin(thickness);

// Initialize our font information.
const auto* fontFace = _settings.FontFace().c_str();
Expand Down Expand Up @@ -1611,8 +1611,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
// Exclude padding from cursor position calculation
COORD terminalPosition = {
static_cast<SHORT>(cursorPosition.X - _root.Padding().Left),
static_cast<SHORT>(cursorPosition.Y - _root.Padding().Top)
static_cast<SHORT>(cursorPosition.X - _swapChainPanel.Margin().Left),
static_cast<SHORT>(cursorPosition.Y - _swapChainPanel.Margin().Top)
};

const auto fontSize = _actualFont.GetSize();
Expand Down

0 comments on commit c687948

Please sign in to comment.