From ff589cd22b761fd4990e3ad7041b47e384b9e07d Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 3 Jun 2014 19:19:51 +0200 Subject: [PATCH] Distinguish single edges from double edges --- src/gui/widgets/BasicBlockWidget.hxx | 29 +++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/gui/widgets/BasicBlockWidget.hxx b/src/gui/widgets/BasicBlockWidget.hxx index 3c61121..3c547b5 100644 --- a/src/gui/widgets/BasicBlockWidget.hxx +++ b/src/gui/widgets/BasicBlockWidget.hxx @@ -19,10 +19,15 @@ public: dx + penWidth, dy + penWidth); - if (next[0]) - result |= QRectF(QPointF(x + dx/3, y+dy), - mapFromScene(next[0]->getEntry())); - + if (next[0]) { + if (next[1]) { + result |= QRectF(QPointF(x + dx/3, y+dy), + mapFromScene(next[0]->getEntry())); + } else { + result |= QRectF(QPointF(x + dx/2, y+dy), + mapFromScene(next[0]->getEntry())); + } + } if (next[1]) result |= QRectF(QPointF(x + 2*dx/3, y+dy), mapFromScene(next[1]->getEntry())); @@ -50,11 +55,17 @@ public: if (_widget.rowCount() != 0) _widget.render(painter); - painter->setPen(QColor(0x00, 0xff, 0x00, 0xff)); - if (next[0]) - painter->drawLine(QPointF(x + dx/3, y+dy), - mapFromScene(next[0]->getEntry())); - + if (next[0]) { + if (next[1]) { + painter->setPen(QColor(0x00, 0xff, 0x00, 0xff)); + painter->drawLine(QPointF(x + dx/3, y+dy), + mapFromScene(next[0]->getEntry())); + } else { + painter->setPen(QColor(0x00, 0x00, 0x00, 0xff)); + painter->drawLine(QPointF(x + dx/2, y+dy), + mapFromScene(next[0]->getEntry())); + } + } painter->setPen(QColor(0xff, 0x00, 0x00, 0xff)); if (next[1]) painter->drawLine(QPointF(x + 2*dx/3, y+dy), -- 2.39.5