aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview/logicblock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_gui/coreview/logicblock.cpp')
-rw-r--r--qtmips_gui/coreview/logicblock.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qtmips_gui/coreview/logicblock.cpp b/qtmips_gui/coreview/logicblock.cpp
index 2e74a77..35ff0c4 100644
--- a/qtmips_gui/coreview/logicblock.cpp
+++ b/qtmips_gui/coreview/logicblock.cpp
@@ -91,7 +91,11 @@ const Connector *LogicBlock::new_connector(qreal x, qreal y) {
QPointF LogicBlock::con_pos(qreal x, qreal y) {
qreal px, py;
- px = (box.right() - GAP) * x + (GAP * sign(x));
- py = (box.bottom()/2 - GAP) * (y + 1) + (GAP * sign(y));
+ px = (box.right() - GAP) * x;
+ py = (box.bottom()/2 - GAP) * (y + 1) + GAP;
+ if (fabs(x) == 1)
+ px += GAP * sign(x);
+ if (fabs(y) == 1)
+ py += GAP * sign(y);
return QPointF(px, py);
}