aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-17 21:36:42 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-17 21:36:42 +0100
commit7fc6f55f75cec552cfe5e9a9eac6a07511ec0e11 (patch)
treecfaf83fb9efd4b32f8ae57f1ca34030d889958b6 /qtmips_gui/coreview
parent6ed6360bfde189191bd976d8969c2834b33ec64e (diff)
downloadqtmips-7fc6f55f75cec552cfe5e9a9eac6a07511ec0e11.tar.gz
qtmips-7fc6f55f75cec552cfe5e9a9eac6a07511ec0e11.tar.bz2
qtmips-7fc6f55f75cec552cfe5e9a9eac6a07511ec0e11.zip
Fix ALU connectors positions
Diffstat (limited to 'qtmips_gui/coreview')
-rw-r--r--qtmips_gui/coreview/alu.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/qtmips_gui/coreview/alu.cpp b/qtmips_gui/coreview/alu.cpp
index 0a60600..d49cab2 100644
--- a/qtmips_gui/coreview/alu.cpp
+++ b/qtmips_gui/coreview/alu.cpp
@@ -41,12 +41,11 @@ void coreview::Alu::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
void coreview::Alu::setPos(qreal x, qreal y) {
QGraphicsItem::setPos(x, y);
- // TODO fix this (should be relative to x and y)
qreal off = ((HEIGHT/2) - DENT) / 2;
- con_in_a->setPos(0, off);
- con_in_b->setPos(0, HEIGHT - off);
- con_out->setPos(WIDTH, HEIGHT/2);
- con_ctl->setPos(WIDTH/2, HEIGHT - (WIDTH/2));
+ con_in_a->setPos(x, y + off);
+ con_in_b->setPos(x, y + HEIGHT - off);
+ con_out->setPos(x + WIDTH, y + HEIGHT/2);
+ con_ctl->setPos(x + WIDTH/2, y + HEIGHT - (WIDTH/2));
}
const coreview::Connector *coreview::Alu::connector_in_a() const {