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
+4 -3
View File
@@ -1716,7 +1716,8 @@ namespace bgfx
}
}
view.m_rect.intersect(rect);
view.m_clippedRect = view.m_rect;
view.m_clippedRect.intersect(rect);
if (!view.m_scissor.isZero() )
{
@@ -6072,13 +6073,13 @@ namespace bgfx
s_ctx->setViewName(_id, bx::StringView(_name, _len) );
}
void setViewRect(ViewId _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
void setViewRect(ViewId _id, int16_t _x, int16_t _y, uint16_t _width, uint16_t _height)
{
BX_ASSERT(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewRect(_id, _x, _y, _width, _height);
}
void setViewRect(ViewId _id, uint16_t _x, uint16_t _y, BackbufferRatio::Enum _ratio)
void setViewRect(ViewId _id, int16_t _x, int16_t _y, BackbufferRatio::Enum _ratio)
{
BX_ASSERT(checkView(_id), "Invalid view id: %d", _id);