From d7319bb99ab84eec0c3608356bada2e5334e3e87 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Mon, 12 Oct 2015 08:18:39 +0200 Subject: [PATCH] Wrap long lines --- src/gui/widgets/CFGScene.cxx | 9 ++++++--- src/gui/widgets/CFGScene.hxx | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/CFGScene.cxx b/src/gui/widgets/CFGScene.cxx index 2c18c7b..271f303 100644 --- a/src/gui/widgets/CFGScene.cxx +++ b/src/gui/widgets/CFGScene.cxx @@ -36,7 +36,8 @@ void CFGScene::drawBackground(QPainter* painter, const QRectF & rect) { * source and destination block. Draw the edge along * the shorter side of that rectangle */ -void CFGScene::drawLine(QPainter* painter, BasicBlockWidget * from, BasicBlockWidget * to, int8_t side) { +void CFGScene::drawLine(QPainter* painter, BasicBlockWidget * from, BasicBlockWidget * to, + int8_t side) { QPointF from_p = from->getExits()[side+1] + QPointF(0, 20); QPointF to_p = to->getEntry() - QPointF(0, 20); if ((to_p - from_p).y() > 0) { @@ -107,8 +108,10 @@ void CFGScene::spaceWidgets() { relevantRect.moveTo(widget->scenePos()); relevantRect.adjust(-20, -20, 20, 20); for (QGraphicsItem * item : items(relevantRect)) { - if (item == widget) continue; - if (std::find(widgets.begin(), widgets.end(), item) == widgets.end()) continue; + if (item == widget) + continue; + if (std::find(widgets.begin(), widgets.end(), item) == widgets.end()) + continue; QRectF itemrect = item->boundingRect(); itemrect.moveTo(item->scenePos()); while (relevantRect.intersects(itemrect)) { diff --git a/src/gui/widgets/CFGScene.hxx b/src/gui/widgets/CFGScene.hxx index 0efacfd..7cdc6d8 100644 --- a/src/gui/widgets/CFGScene.hxx +++ b/src/gui/widgets/CFGScene.hxx @@ -23,7 +23,8 @@ public: private: std::vector widgets; - void drawLine(QPainter* painter, BasicBlockWidget * from, BasicBlockWidget * to, int8_t side = 0); + void drawLine(QPainter* painter, BasicBlockWidget * from, BasicBlockWidget * to, + int8_t side = 0); void spaceWidgets(); -- 2.39.5