| 36 | |
| 37 | |
| 38 | QPainterPath |
| 39 | ConnectionPainter:: |
| 40 | getPainterStroke(ConnectionGeometry const& geom) |
| 41 | { |
| 42 | auto cubic = cubicPath(geom); |
| 43 | |
| 44 | QPointF const& source = geom.source(); |
| 45 | QPainterPath result(source); |
| 46 | |
| 47 | unsigned segments = 20; |
| 48 | |
| 49 | for (auto i = 0ul; i < segments; ++i) |
| 50 | { |
| 51 | double ratio = double(i + 1) / segments; |
| 52 | result.lineTo(cubic.pointAtPercent(ratio)); |
| 53 | } |
| 54 | |
| 55 | QPainterPathStroker stroker; stroker.setWidth(10.0); |
| 56 | |
| 57 | return stroker.createStroke(result); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | #ifdef NODE_DEBUG_DRAWING |