Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui][fix] Edge: Fixing an issue with mouse event on Custom EdgeMouseArea causing Crash #2650

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions meshroom/ui/components/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, evt):
x = Property(float, lambda self: self._x, constant=True)
y = Property(float, lambda self: self._y, constant=True)
button = Property(Qt.MouseButton, lambda self: self._button, constant=True)
modifiers = Property(int, lambda self: self._modifiers, constant=True)
modifiers = Property(Qt.KeyboardModifier, lambda self: self._modifiers, constant=True)


class EdgeMouseArea(QQuickItem):
Expand Down Expand Up @@ -47,8 +47,8 @@ def hoverLeaveEvent(self, evt):
self.setContainsMouse(False)
super(EdgeMouseArea, self).hoverLeaveEvent(evt)

def geometryChanged(self, newGeometry, oldGeometry):
super(EdgeMouseArea, self).geometryChanged(newGeometry, oldGeometry)
def geometryChange(self, newGeometry, oldGeometry):
super(EdgeMouseArea, self).geometryChange(newGeometry, oldGeometry)
self.updateShape()

def mousePressEvent(self, evt):
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/qml/GraphEditor/Edge.qml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Item {
/* The curve scale must be set only once the component has been fully created, so
* that all the events following the update of the curve scale can be taken into
* account. */
curveScale = Qt.binding(() => cubic.ctrlPtDist / root.width) // Normalize by width
curveScale = cubic.ctrlPtDist / root.width // Normalize by width
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can be moved back to a normal binding in the edgeArea (we don't need the Component.onCompleted anymore).

curveScale: cubic.ctrlPtDist / root.width

}
}
}
Loading