From 9d361d2c33e5bb87b283be70bfbed70a562c5018 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Mon, 21 Oct 2024 16:14:09 -0700 Subject: [PATCH] Fix more rendering issues w/ Leonard --- src/buffer/out/UTextAdapter.cpp | 5 +---- src/renderer/atlas/AtlasEngine.api.cpp | 4 ++-- src/renderer/atlas/AtlasEngine.cpp | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/buffer/out/UTextAdapter.cpp b/src/buffer/out/UTextAdapter.cpp index ff0861ce54d..a76d2aa55e9 100644 --- a/src/buffer/out/UTextAdapter.cpp +++ b/src/buffer/out/UTextAdapter.cpp @@ -417,10 +417,7 @@ til::point_span Microsoft::Console::ICU::BufferRangeFromMatch(UText* ut, URegula { UErrorCode status = U_ZERO_ERROR; const auto nativeIndexBeg = uregex_start64(re, 0, &status); - auto nativeIndexEnd = uregex_end64(re, 0, &status); - - // The parameters are given as a half-open [beg,end) range, but the point_span we return in closed [beg,end]. - nativeIndexEnd--; + const auto nativeIndexEnd = uregex_end64(re, 0, &status); const auto& textBuffer = *static_cast(ut->context); til::point_span ret; diff --git a/src/renderer/atlas/AtlasEngine.api.cpp b/src/renderer/atlas/AtlasEngine.api.cpp index a80ae930ba9..10cf2e3a405 100644 --- a/src/renderer/atlas/AtlasEngine.api.cpp +++ b/src/renderer/atlas/AtlasEngine.api.cpp @@ -89,11 +89,11 @@ void AtlasEngine::_invalidateSpans(std::span spans, const const auto viewport = til::rect{ 0, 0, _api.s->viewportCellCount.x, _api.s->viewportCellCount.y }; for (auto&& sp : spans) { - sp.iterate_rows(til::CoordTypeMax, [&](til::CoordType row, til::CoordType beg, til::CoordType end) { + sp.iterate_rows_exclusive(til::CoordTypeMax, [&](til::CoordType row, til::CoordType beg, til::CoordType end) { const auto shift = buffer.GetLineRendition(row) != LineRendition::SingleWidth ? 1 : 0; beg <<= shift; end <<= shift; - til::rect rect{ beg, row, end + 1, row + 1 }; + til::rect rect{ beg, row, end, row + 1 }; rect = rect.to_origin(viewportOrigin); rect &= viewport; _api.invalidatedRows.start = gsl::narrow_cast(std::min(_api.invalidatedRows.start, std::max(0, rect.top))); diff --git a/src/renderer/atlas/AtlasEngine.cpp b/src/renderer/atlas/AtlasEngine.cpp index 407353f8d6d..ac1cdc6a6f1 100644 --- a/src/renderer/atlas/AtlasEngine.cpp +++ b/src/renderer/atlas/AtlasEngine.cpp @@ -433,7 +433,7 @@ try // Return early if we couldn't paint the whole region (either this was not the last row, or // it was the last row but the highlight ends outside of our x range.) // We will resume from here in the next call. - if (!isFinalRow || hiEnd.x /*inclusive*/ >= x2 /*exclusive*/) + if (!isFinalRow || hiEnd.x /*inclusive*/ > x2 /*exclusive*/) { return S_OK; }