From 7fc6f55f75cec552cfe5e9a9eac6a07511ec0e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 17 Jan 2018 21:36:42 +0100 Subject: Fix ALU connectors positions --- qtmips_gui/coreview/alu.cpp | 9 ++++----- 1 file 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 { -- cgit v1.2.3