diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2017-05-04 13:30:43 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2017-05-05 04:48:04 +0000 |
commit | 6e5acfcce3c287c30bab4cdc6fc5f7545a15255e (patch) | |
tree | b87bf48d453a49aab4670f6037152fc1e53b6465 /src | |
parent | 043b8bc956eafcf63da88ef011e73bb5dbcc6683 (diff) |
Scene2D: put picking coordinates back in window coordinates
We get the picking coordinates in model local tex coords which have a
different convention than the mouse events in window coordinates. So
flip them vertically to pass them in the right convention.
Change-Id: I558cc62c7c820677407730eead8011193a4b967c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick3d/quick3dscene2d/items/scene2d.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick3d/quick3dscene2d/items/scene2d.cpp b/src/quick3d/quick3dscene2d/items/scene2d.cpp index 13165c280..88b4d9e86 100644 --- a/src/quick3d/quick3dscene2d/items/scene2d.cpp +++ b/src/quick3d/quick3dscene2d/items/scene2d.cpp @@ -486,7 +486,7 @@ void Scene2D::handlePickEvent(int type, const Qt3DRender::QPickEventPtr &ev) ci.setW(1.0f); const QSize size = m_sharedObject->m_quickWindow->size(); - QPointF pos = QPointF(ci.x() * size.width(), ci.y() * size.height()); + QPointF pos = QPointF(ci.x() * size.width(), (1.0f - ci.y()) * size.height()); QMouseEvent *mouseEvent = new QMouseEvent(static_cast<QEvent::Type>(type), pos, pos, pos, |