[ui] Edge: fix control points distance

Avoid getting increasingly distorted curves with edge width.
This commit is contained in:
Yann Lanthony 2020-01-24 11:52:23 +01:00
parent 61866708ac
commit efb8e1ed67

View file

@ -46,8 +46,7 @@ Shape {
PathCubic {
id: cubic
property real curveScale: 0.7
property real ctrlPtDist: Math.abs(root.width * curveScale)
property real ctrlPtDist: 30
x: root.endX
y: root.endY
relativeControl1X: ctrlPtDist; relativeControl1Y: 0
@ -58,7 +57,7 @@ Shape {
EdgeMouseArea {
id: edgeArea
anchors.fill: parent
curveScale: cubic.curveScale
curveScale: cubic.ctrlPtDist / root.width // normalize by width
acceptedButtons: Qt.LeftButton | Qt.RightButton
thickness: root.thickness + 4
onPressed: root.pressed(arguments[0]) // can't get named args, use arguments array