| 64 | } |
| 65 | |
| 66 | QRectF 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 | |
| 85 | QPainterPath IPProcessEdge::shape() const |
| 86 | { |
no test coverage detected