mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 09:27:00 +00:00
Fix scissor offset being negative
This commit is contained in:
parent
509df3e279
commit
e0244c8f62
@ -301,8 +301,8 @@ void ImGui_ImplGlfwVulkan_RenderDrawLists(ImDrawData* draw_data)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
VkRect2D scissor;
|
VkRect2D scissor;
|
||||||
scissor.offset.x = (int32_t)(pcmd->ClipRect.x);
|
scissor.offset.x = (int32_t)(pcmd->ClipRect.x) > 0 ? (int32_t)(pcmd->ClipRect.x) : 0; // clamp these to 0, scissor offset.xy must be > 0
|
||||||
scissor.offset.y = (int32_t)(pcmd->ClipRect.y);
|
scissor.offset.y = (int32_t)(pcmd->ClipRect.y) > 0 ? (int32_t)(pcmd->ClipRect.y) : 0;
|
||||||
scissor.extent.width = (uint32_t)(pcmd->ClipRect.z - pcmd->ClipRect.x);
|
scissor.extent.width = (uint32_t)(pcmd->ClipRect.z - pcmd->ClipRect.x);
|
||||||
scissor.extent.height = (uint32_t)(pcmd->ClipRect.w - pcmd->ClipRect.y + 1); // TODO: + 1??????
|
scissor.extent.height = (uint32_t)(pcmd->ClipRect.w - pcmd->ClipRect.y + 1); // TODO: + 1??????
|
||||||
vkCmdSetScissor(g_CommandBuffer, 0, 1, &scissor);
|
vkCmdSetScissor(g_CommandBuffer, 0, 1, &scissor);
|
||||||
|
Loading…
Reference in New Issue
Block a user