MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / dragDest

Method dragDest

Gui/Edge.cpp:725–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

723}
724
725void
726Edge::dragDest(const QPointF & dst)
727{
728 setLine( QLineF( dst, line().p2() ) );
729
730 double a = std::acos( line().dx() / std::max( EDGE_LENGTH_MIN, line().length() ) );
731 if (line().dy() < 0) {
732 a = 2 * M_PI - a;
733 }
734
735 double arrowSize = TO_DPIX(ARROW_SIZE_DISCONNECTED);
736 QPointF arrowP1 = line().p1() + QPointF(std::cos(a + ARROW_HEAD_ANGLE / 2) * arrowSize,
737 std::sin(a + ARROW_HEAD_ANGLE / 2) * arrowSize);
738 QPointF arrowP2 = line().p1() + QPointF(std::cos(a - ARROW_HEAD_ANGLE / 2) * arrowSize,
739 std::sin(a - ARROW_HEAD_ANGLE / 2) * arrowSize);
740 _imp->arrowHead.clear();
741 _imp->arrowHead << line().p1() << arrowP1 << arrowP2;
742}
743
744void
745Edge::setBendPointVisible(bool visible)

Callers 1

mouseMoveEventMethod · 0.80

Calls 9

maxFunction · 0.85
p2Method · 0.80
lengthMethod · 0.80
p1Method · 0.80
QPointFClass · 0.70
acosFunction · 0.50
cosFunction · 0.50
sinFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected