Fix magnifier location

This commit is contained in:
Brad Davis 2015-05-11 13:52:36 -07:00
parent c12b74ebd0
commit e58976fe5a

View file

@ -1226,19 +1226,17 @@ glm::vec2 ApplicationOverlay::sphericalToOverlay(const glm::vec2& sphericalPos)
result /= _textureFov;
result.x /= _textureAspectRatio;
result += 0.5f;
result.x = (-sphericalPos.x / (_textureFov * _textureAspectRatio) + 0.5f);
result.y = (sphericalPos.y / _textureFov + 0.5f);
result *= qApp->getCanvasSize();
return result;
}
glm::vec2 ApplicationOverlay::overlayToSpherical(const glm::vec2& overlayPos) const {
glm::vec2 result = overlayPos;
result.x *= -1.0;
result /= qApp->getCanvasSize();
result -= 0.5f;
result *= _textureFov;
result.x *= _textureAspectRatio;
result.x *= -1.0f;
return result;
}