Skip to content

Commit

Permalink
dx: when filling an HWND target, use the actual background color (mic…
Browse files Browse the repository at this point in the history
…rosoft#5848)

There is no guarantee that the HWND's backing color matches our expected
backing color.

This repairs the gutter in the WPF terminal.
  • Loading branch information
DHowett authored May 11, 2020
1 parent e7a2732 commit 177fd74
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/renderer/dx/DxRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,12 @@ CATCH_RETURN()
[[nodiscard]] HRESULT DxEngine::PaintBackground() noexcept
try
{
D2D1_COLOR_F nothing = { 0 };
D2D1_COLOR_F nothing{ 0 };
if (_chainMode == SwapChainMode::ForHwnd)
{
// When we're drawing over an HWND target, we need to fully paint the background color.
nothing = _backgroundColor;
}

// If the entire thing is invalid, just use one big clear operation.
if (_invalidMap.all())
Expand Down

0 comments on commit 177fd74

Please sign in to comment.