[ui] GraphEditor: improve dash pattern on edges

- Avoid variation in dash pattern when the stroke is hovered by compensating strokeWidth.
- Use a dash pattern of [6,4] to get a stronger feeling of a dashed line (VS a dotted line).
This commit is contained in:
Fabien Castan 2020-12-28 12:01:17 +01:00
parent 3fe6c22bc2
commit 85044e50cb

View file

@ -42,9 +42,11 @@ Shape {
fillColor: "transparent"
strokeColor: "#3E3E3E"
strokeStyle: edge != undefined && ((edge.src != undefined && edge.src.isOutput) || edge.dst == undefined) ? ShapePath.SolidLine : ShapePath.DashLine
dashPattern: [4, 4]
capStyle: ShapePath.RoundCap
strokeWidth: 1
// final visual width of this path (never below 1)
readonly property real visualWidth: Math.max(strokeWidth, 1)
dashPattern: [6/visualWidth, 4/visualWidth]
capStyle: ShapePath.RoundCap
PathCubic {
id: cubic