MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / boundingRect

Method boundingRect

ImagePlay/src/IPProcessEdge.cpp:66–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66QRectF IPProcessEdge::boundingRect() const
67{
68 float minX = std::min(_intersectionFrom.x(), _intersectionTo.x());
69 float maxX = std::max(_intersectionFrom.x(), _intersectionTo.x());
70 float minY = std::min(_intersectionFrom.y(), _intersectionTo.y());
71 float maxY = std::max(_intersectionFrom.y(), _intersectionTo.y());
72
73 // add some margin for straight vertical or horizontal lines
74 minX -= 10;
75 maxX += 10;
76 minY -= 10;
77 maxY += 10;
78
79 float width = std::abs(maxX-minX);
80 float height = std::abs(maxY-minY);
81
82 return QRectF(minX, minY, width, height);
83}
84
85QPainterPath IPProcessEdge::shape() const
86{

Callers 1

updatePositionMethod · 0.45

Calls 3

minFunction · 0.50
maxFunction · 0.50
absFunction · 0.50

Tested by

no test coverage detected