Allow negative x/y in bgfx::setViewRect. (#3848)

This commit is contained in:
Branimir Karadžić
2026-07-25 15:04:06 +00:00
committed by GitHub
parent 7551ac61c5
commit ce18bdb6c6
23 changed files with 167 additions and 152 deletions
+3 -2
View File
@@ -6156,10 +6156,11 @@ namespace bgfx { namespace d3d11
}
viewState.m_rect = _render->m_view[view].m_rect;
const Rect& clippedRect = _render->m_view[view].m_clippedRect;
const Rect& scissorRect = _render->m_view[view].m_scissor;
viewHasScissor = !scissorRect.isZero();
viewScissorRect = viewHasScissor ? scissorRect : viewState.m_rect;
viewScissorRect = viewHasScissor ? scissorRect : clippedRect;
D3D11_VIEWPORT vp;
vp.TopLeftX = viewState.m_rect.m_x;
@@ -6173,7 +6174,7 @@ namespace bgfx { namespace d3d11
if (BGFX_CLEAR_NONE != (clr.m_flags & BGFX_CLEAR_MASK) )
{
clearQuad(_clearQuad, viewState.m_rect, clr, _render->m_colorPalette);
clearQuad(_clearQuad, clippedRect, clr, _render->m_colorPalette);
prim = s_primInfo[Topology::Count]; // Force primitive type update after clear quad.
}