[ui] AlembicLoader: only select cameras on still left-clicks

don't trigger Camera selection if mouse has moved to rotate camera
This commit is contained in:
Yann Lanthony 2019-09-10 19:43:14 +02:00
parent 796517ccb1
commit 2a3093b292
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642

View file

@ -57,10 +57,22 @@ AlembicEntity {
},
ObjectPicker {
id: cameraPicker
onPressed: pick.accepted = cameraPickingEnabled
onReleased: _reconstruction.selectedViewId = camSelector.viewId
property point pos
onPressed: {
pos = pick.position;
pick.accepted = (pick.buttons & Qt.LeftButton) && cameraPickingEnabled
}
onReleased: {
const delta = Qt.point(Math.abs(pos.x - pick.position.x), Math.abs(pos.y - pick.position.y));
// only trigger picking when mouse has not moved between press and release
if(delta.x + delta.y < 4)
{
_reconstruction.selectedViewId = camSelector.viewId;
}
}
}
]
}
}
}