Skip to content

Commit

Permalink
AtlasEngine: Stop resizing buffers on scroll (#13100)
Browse files Browse the repository at this point in the history
This regressed in ad2358d.
We're interested in the size of the viewport only, but it can shift up/down
during scrolling. In these situations we shouldn't resize our buffers of course.

## Validation Steps Performed
* Scroll
* Not setting `ApiInvalidations::Size` ✅
  • Loading branch information
lhecker committed May 17, 2022
1 parent b699f92 commit fa6b066
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/renderer/atlas/AtlasEngine.api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,15 @@ constexpr HRESULT vec2_narrow(U x, U y, AtlasEngine::vec2<T>& out) noexcept

[[nodiscard]] HRESULT AtlasEngine::UpdateViewport(const SMALL_RECT srNewViewport) noexcept
{
_api.cellCount.x = gsl::narrow_cast<u16>(srNewViewport.Right - srNewViewport.Left + 1);
_api.cellCount.y = gsl::narrow_cast<u16>(srNewViewport.Bottom - srNewViewport.Top + 1);
WI_SetFlag(_api.invalidations, ApiInvalidations::Size);
const u16x2 cellCount{
gsl::narrow_cast<u16>(srNewViewport.Right - srNewViewport.Left + 1),
gsl::narrow_cast<u16>(srNewViewport.Bottom - srNewViewport.Top + 1),
};
if (_api.cellCount != cellCount)
{
_api.cellCount = cellCount;
WI_SetFlag(_api.invalidations, ApiInvalidations::Size);
}
return S_OK;
}

Expand Down

0 comments on commit fa6b066

Please sign in to comment.