From 14b8c242cf965222e8776732fb67aba2879adf37 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 28 Jul 2011 07:47:06 +0000 Subject: [PATCH] From Jason Beverage, merged from svn/trunk revision 12723, "Here is a small fix for getCameraContainingPosition. getXMin was being used in a case where getYMin should be used instead." --- src/osgViewer/View.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgViewer/View.cpp b/src/osgViewer/View.cpp index ada376867..a51fb192a 100644 --- a/src/osgViewer/View.cpp +++ b/src/osgViewer/View.cpp @@ -2007,7 +2007,7 @@ const osg::Camera* View::getCameraContainingPosition(float x, float y, float& lo new_x = static_cast(_camera->getGraphicsContext()->getTraits()->width) * (x - eventState->getXmin())/(eventState->getXmax()-eventState->getXmin()); new_y = view_invert_y ? static_cast(_camera->getGraphicsContext()->getTraits()->height) * (1.0 - (y- eventState->getYmin())/(eventState->getYmax()-eventState->getYmin())) : - static_cast(_camera->getGraphicsContext()->getTraits()->height) * (y - eventState->getYmin())/(eventState->getYmax()-eventState->getXmin()); + static_cast(_camera->getGraphicsContext()->getTraits()->height) * (y - eventState->getYmin())/(eventState->getYmax()-eventState->getYmin()); } if (viewport &&