MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / getPainterStroke

Method getPainterStroke

QtNodeEditor/src/ConnectionPainter.cpp:38–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37
38QPainterPath
39ConnectionPainter::
40getPainterStroke(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

Callers

nothing calls this directly

Calls 2

cubicPathFunction · 0.85
sourceMethod · 0.80

Tested by

no test coverage detected