From ea044b4bb31b88507f191a764dc47e86c44858da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 21 Jan 2018 18:29:02 +0100 Subject: Fix problems with connections rerendeering There was bug in boundary rect. calculation. --- qtmips_gui/coreview/connection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qtmips_gui/coreview') diff --git a/qtmips_gui/coreview/connection.cpp b/qtmips_gui/coreview/connection.cpp index 31d93e5..f7271c7 100644 --- a/qtmips_gui/coreview/connection.cpp +++ b/qtmips_gui/coreview/connection.cpp @@ -95,8 +95,8 @@ void Connection::moved_end(QLineF p) { QRectF Connection::boundingRect() const { QRectF rect; for (int i = 0; i < (points.size() - 1); i++) { - qreal x = points[i].x() > points[i+1].x() ? points[i].x() : points[i+1].x(); - qreal y = points[i].y() > points[i+1].y() ? points[i].y() : points[i+1].y(); + qreal x = points[i].x() > points[i+1].x() ? points[i+1].x() : points[i].x(); + qreal y = points[i].y() > points[i+1].y() ? points[i+1].y() : points[i].y(); rect |= QRectF(x - pen_width/2.0, y - pen_width/2.0, fabs(points[i].x() - points[i+1].x()) + pen_width, fabs(points[i].y() - points[i+1].y()) + pen_width); } return rect; -- cgit v1.2.3