mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 00:38:41 +02:00
[ui] Viewer3D: TransformGizmo - individual color picking
This commit is contained in:
parent
45fae981ba
commit
6a9f229838
2 changed files with 41 additions and 18 deletions
|
@ -9,21 +9,25 @@ ObjectPicker {
|
|||
id: root
|
||||
hoverEnabled: true
|
||||
property bool isPressed : false
|
||||
property MouseHandler mouseController
|
||||
property var objectMaterial
|
||||
property color objectBaseColor
|
||||
|
||||
signal pickedChanged(bool picked)
|
||||
|
||||
onPressed: {
|
||||
root.isPressed = true
|
||||
pickedChanged(true)
|
||||
mouseHandler.currentPosition = mouseHandler.lastPosition = pick.position
|
||||
mouseController.currentPosition = mouseController.lastPosition = pick.position
|
||||
}
|
||||
onEntered: {
|
||||
material.ambient = "white"
|
||||
objectMaterial.ambient = "white"
|
||||
}
|
||||
onExited: {
|
||||
if(!isPressed) material.ambient = baseColor
|
||||
if(!isPressed) objectMaterial.ambient = objectBaseColor
|
||||
}
|
||||
onReleased: {
|
||||
material.ambient = baseColor
|
||||
objectMaterial.ambient = objectBaseColor
|
||||
root.isPressed = false
|
||||
pickedChanged(false)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue