validate scissor dimensions

pull/37/head
cosmonaut 2022-12-13 16:09:32 -08:00
parent ca61e94b13
commit debb76f62a
1 changed files with 5 additions and 0 deletions

View File

@ -823,6 +823,11 @@ namespace MoonWorks.Graphics
{
#if DEBUG
AssertRenderPassActive();
if (scissor.X < 0 || scissor.Y < 0 || scissor.W <= 0 || scissor.H <= 0)
{
throw new System.ArgumentOutOfRangeException("Scissor position cannot be negative and dimensions must be positive!");
}
#endif
Refresh.Refresh_SetScissor(