From 07b9760583107dcd96abff27d49825fd51211571 Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Sun, 23 Nov 2014 00:12:31 +0100 Subject: [PATCH] Turning on nvg scissor in imguiScroll. --- examples/common/imgui/imgui.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index c6d47386..6978879a 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -891,6 +891,13 @@ struct Imgui setEnabled(m_areaId); } + nvgScissor(m_nvg + , float(area.m_scissorX) + , float(area.m_scissorY-1) + , float(area.m_scissorWidth) + , float(area.m_scissorHeight+1) + ); + m_insideArea |= area.m_inside; return area.m_inside; @@ -1041,6 +1048,8 @@ struct Imgui } } + nvgResetScissor(m_nvg); + area.m_inside = false; m_areaId.previous(); @@ -1116,10 +1125,10 @@ struct Imgui } nvgScissor(m_nvg - , float(area.m_x) - , float(area.m_y-1) - , float(area.m_width) - , float(area.m_height+1) + , float(area.m_scissorX) + , float(area.m_scissorY-1) + , float(area.m_scissorWidth) + , float(area.m_scissorHeight+1) ); area.m_scissorEnabled = true;