mirror of
https://github.com/OpenMW/openmw.git
synced 2026-01-03 13:13:08 +00:00
Use devicePixelRatio directly
This commit is contained in:
parent
759734beb4
commit
2f002b885e
1 changed files with 2 additions and 7 deletions
|
|
@ -411,14 +411,9 @@ std::optional<CSVRender::WorldspaceHitResult> CSVRender::WorldspaceWidget::check
|
|||
std::tuple<osg::Vec3d, osg::Vec3d, osg::Vec3d> CSVRender::WorldspaceWidget::getStartEndDirection(
|
||||
int pointX, int pointY) const
|
||||
{
|
||||
// may be okay to just use devicePixelRatio() directly
|
||||
QScreen* screen = SceneWidget::windowHandle() && SceneWidget::windowHandle()->screen()
|
||||
? SceneWidget::windowHandle()->screen()
|
||||
: QGuiApplication::primaryScreen();
|
||||
|
||||
// (0,0) is considered the lower left corner of an OpenGL window
|
||||
int x = pointX * screen->devicePixelRatio();
|
||||
int y = height() * screen->devicePixelRatio() - pointY * screen->devicePixelRatio();
|
||||
int x = pointX * devicePixelRatio();
|
||||
int y = height() * devicePixelRatio() - pointY * devicePixelRatio();
|
||||
|
||||
// Convert from screen space to world space
|
||||
osg::Matrixd wpvMat;
|
||||
|
|
|
|||
Loading…
Reference in a new issue