MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / setLengthRate

Method setLengthRate

graph_view.cpp:872–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872void MyGraphicsLineItem::setLengthRate(qreal r){
873 sP = startVex->scenePos() + startVex->rect().center();
874 eP = endVex->scenePos() + endVex->rect().center();
875 dP = eP - sP;
876 angle = atan2(dP.y(), dP.x());
877 eP -= QPointF(endVex->getRadius() * cos(angle), endVex->getRadius() * sin(angle));
878 sP += QPointF(endVex->getRadius() * cos(angle), endVex->getRadius() * sin(angle));
879 dP = (eP - sP) * r;
880 eP = sP + dP;
881}
882
883void MyGraphicsLineItem::estConnection(MyGraphicsView *view){
884 connect(view, SIGNAL(mouseMoved(QPointF)), this, SLOT(onMouseMove(QPointF)));

Callers

nothing calls this directly

Calls 1

getRadiusMethod · 0.80

Tested by

no test coverage detected