diff options
Diffstat (limited to '')
-rw-r--r-- | src/menu/clipping_helper.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/menu/clipping_helper.cpp b/src/menu/clipping_helper.cpp index e12823cc..3f6bc4cd 100644 --- a/src/menu/clipping_helper.cpp +++ b/src/menu/clipping_helper.cpp @@ -31,6 +31,12 @@ namespace usdx log4cpp::Category& ClippingHelper::log = log4cpp::Category::getInstance("usdx.menu.clipping_helper"); + Rectangle<int> ClippingHelper::makeRect(GLint box[4]) + { + return Rectangle<int>(Point<int>(box[0], box[1]), + Point<int>(box[0] + box[2], box[1] + box[3])); + } + ClippingHelper::ClippingHelper(const Rectangle<int> &rect) { was_enabled = glIsEnabled(GL_SCISSOR_TEST); @@ -40,7 +46,7 @@ namespace usdx if (was_enabled) { glGetIntegerv(GL_SCISSOR_BOX, scissor_box); - new_scissor_box = rect.intersect(Rectangle<int>(scissor_box)); + new_scissor_box = new_scissor_box.intersect(makeRect(scissor_box)); } log << log4cpp::Priority::DEBUG << "Clipping (" |