Skip to content

Commit

Permalink
Fix incorrect clipping due to stale viewport dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
s1sw committed Oct 3, 2024
1 parent a903d8f commit 9ab8458
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Include/RmlUi/Core/RenderManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class RMLUICORE_API RenderManager : NonCopyMoveable {
RenderManager(RenderInterface* render_interface);
~RenderManager();

void PrepareRender();
void PrepareRender(Vector2i dimensions);
void SetViewport(Vector2i dimensions);
Vector2i GetViewport() const;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ bool Context::Render()
{
RMLUI_ZoneScoped;

render_manager->PrepareRender();
render_manager->PrepareRender(dimensions);

root->Render();

Expand Down
4 changes: 3 additions & 1 deletion Source/Core/RenderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ RenderManager::~RenderManager()
ReleaseAllTextures();
}

void RenderManager::PrepareRender()
void RenderManager::PrepareRender(Vector2i dimensions)
{
#ifdef RMLUI_DEBUG
const RenderState default_state;
Expand All @@ -77,6 +77,8 @@ void RenderManager::PrepareRender()
RMLUI_ASSERT(state.transform == default_state.transform);
RMLUI_ASSERTMSG(render_stack.empty(), "Unbalanced render stack detected, ensure every PushLayer call has a corresponding call to PopLayer.");
#endif

SetViewport(dimensions);
}

void RenderManager::SetViewport(Vector2i dimensions)
Expand Down

0 comments on commit 9ab8458

Please sign in to comment.