diff --git a/libs/openFrameworks/3d/ofEasyCam.cpp b/libs/openFrameworks/3d/ofEasyCam.cpp index 00cf71a4c2d..c1344f11fa1 100644 --- a/libs/openFrameworks/3d/ofEasyCam.cpp +++ b/libs/openFrameworks/3d/ofEasyCam.cpp @@ -296,16 +296,16 @@ void ofEasyCam::updateTranslation(){ if(getOrtho()){ //In ortho mode moving along the z axis has no effect besides clipping. // Instead, scale is applied to achieve the effect of getting near or far from the target. - glm::vec3 mousePre ; + glm::vec3 mousePre; bool bDoScale = (currentTransformType == TRANSFORM_SCALE || currentTransformType == TRANSFORM_TRANSLATE_Z); if (bDoScale) { - mousePre = screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0)); + mousePre = screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0), viewport); } move(glm::vec3(lastPressAxisX * translate.x) + (lastPressAxisY * translate.y)); if (bDoScale) { setScale(getScale() + translate.z); // this move call is to keep the scaling centered below the mouse. - move(mousePre - screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0))); + move(mousePre - screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0), viewport)); } }else{ move(glm::vec3(lastPressAxisX * translate.x) + (lastPressAxisY * translate.y) + (lastPressAxisZ * translate.z));