mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-02 16:28:51 +02:00
[ui] CameraController: avoid allocating new objects on bindings
Change existing objects values instead of re-creating point/size objects, on bindings that can be evaluated very often.
This commit is contained in:
parent
1793a30861
commit
829aa24a4a
2 changed files with 7 additions and 3 deletions
|
@ -44,7 +44,8 @@ Entity {
|
|||
sourceDevice: mouseSourceDevice
|
||||
onPressed: {
|
||||
_pressed = true;
|
||||
currentPosition = lastPosition = Qt.point(mouse.x, mouse.y);
|
||||
currentPosition.x = lastPosition.x = mouse.x;
|
||||
currentPosition.y = lastPosition.y = mouse.y;
|
||||
mousePressed(mouse);
|
||||
}
|
||||
onReleased: {
|
||||
|
@ -52,7 +53,7 @@ Entity {
|
|||
mouseReleased(mouse);
|
||||
}
|
||||
onClicked: mouseClicked(mouse)
|
||||
onPositionChanged: { currentPosition = Qt.point(mouse.x, mouse.y) }
|
||||
onPositionChanged: { currentPosition.x = mouse.x; currentPosition.y = mouse.y }
|
||||
onDoubleClicked: mouseDoubleClicked(mouse)
|
||||
onWheel: {
|
||||
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue