diff options
author | Karel Kočí <cynerd@email.cz> | 2018-01-21 18:22:07 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-01-21 18:22:07 +0100 |
commit | 74ff0f2d5282adf5ce36c9faeb2a5e85c358bf23 (patch) | |
tree | 4d31bff7ddb830c2d6b14cd9df4abe6c13e27878 /qtmips_gui/coreview/logicblock.cpp | |
parent | 16b1544fff7e9ca11deb3ae1b891c79eac7ec50e (diff) | |
download | qtmips-74ff0f2d5282adf5ce36c9faeb2a5e85c358bf23.tar.gz qtmips-74ff0f2d5282adf5ce36c9faeb2a5e85c358bf23.tar.bz2 qtmips-74ff0f2d5282adf5ce36c9faeb2a5e85c358bf23.zip |
Implement even more parts of the schema
Diffstat (limited to 'qtmips_gui/coreview/logicblock.cpp')
-rw-r--r-- | qtmips_gui/coreview/logicblock.cpp | 8 |
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); } |