Skip to content

Commit

Permalink
Fix the color of marks (#16106)
Browse files Browse the repository at this point in the history
Guess what _doesn't_ have the same layout as a bitmap? A `til::color`.

Noticed in 1.19.

Regressed in #16006

(cherry picked from commit 1745857)
Service-Card-Id: 90758500
Service-Version: 1.19
  • Loading branch information
zadjii-msft authored and DHowett committed Oct 26, 2023
1 parent 229ba89 commit c027501
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const auto end = beg + pipHeight * stride;
for (; beg < end; beg += stride)
{
// Coincidentally a til::color has the same RGBA format as the bitmap.
// a til::color does NOT have the same RGBA format as the bitmap.
#pragma warning(suppress : 26490) // Don't use reinterpret_cast (type.1).
std::fill_n(reinterpret_cast<til::color*>(beg), pipWidth, color);
const DWORD c = 0xff << 24 | color.r << 16 | color.g << 8 | color.b;
std::fill_n(reinterpret_cast<DWORD*>(beg), pipWidth, c);
}
};

Expand Down

0 comments on commit c027501

Please sign in to comment.