Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect clipping due to stale viewport dimensions #680

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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