diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2018-11-30 10:37:29 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2018-11-30 10:33:08 +0000 |
commit | 9745006dadf5685f4ff82c6234938e19b9402801 (patch) | |
tree | f128f5bbd615d2ca89fe28ab3d186784f7796fb9 /src | |
parent | 68f84a0c445defc23c2508420734365502134549 (diff) |
Reset last selected picker when releasing out of viewport
Change-Id: Iec70e84024caf879358183fee34638def5038aef
Task-number: QTBUG-72160
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/render/jobs/pickboundingvolumejob.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/render/jobs/pickboundingvolumejob.cpp b/src/render/jobs/pickboundingvolumejob.cpp index 2f1eb4cd8..2050b8772 100644 --- a/src/render/jobs/pickboundingvolumejob.cpp +++ b/src/render/jobs/pickboundingvolumejob.cpp @@ -232,8 +232,14 @@ bool PickBoundingVolumeJob::runHelper() for (const PickingUtils::ViewportCameraAreaDetails &vca : vcaDetails) { PickingUtils::HitList sphereHits; QRay3D ray = rayForViewportAndCamera(vca, event.first, event.second.pos()); - if (!ray.isValid()) + if (!ray.isValid()) { + // An invalid rays is when we've lost our surface or the mouse + // has moved out of the viewport In case of a button released + // outside of the viewport, we still want to notify the + // lastCurrent entity about this. + dispatchPickEvents(event.second, PickingUtils::HitList(), eventButton, eventButtons, eventModifiers, allHitsRequested); continue; + } PickingUtils::HierarchicalEntityPicker entityPicker(ray); if (entityPicker.collectHits(m_manager, m_node)) { |