From ae2a3c64ef800b53f6492caf89166a8105963859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20Rajkovi=C4=87?= Date: Sun, 12 Jun 2022 16:40:35 +0200 Subject: [PATCH] Fixed pin selection --- comdel/display/schema_display.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/comdel/display/schema_display.cpp b/comdel/display/schema_display.cpp index defaa68..cd2db37 100644 --- a/comdel/display/schema_display.cpp +++ b/comdel/display/schema_display.cpp @@ -175,13 +175,14 @@ namespace display { continue; } auto pinInstance = domain::ConnectionComponent{connection.componentInstance.value()->name, connection.pin.value().getName()}; - auto rect = pins[pinInstance]->boundingRect(); - rect.setX(pins[pinInstance]->scenePos().x()); - rect.setY(pins[pinInstance]->scenePos().y()); + auto pin = pins[pinInstance]->getPin().getDisplayPin(); + auto position = pins[pinInstance]->getComponentInstance()->position; + + auto rect = QRectF(position.first + pin.x, position.second + pin.y, pin.w, pin.h); if (rect.contains(endPoint)) { auto name = components[pinInstance.component]->getComponentInstance()->component.getName(); - auto con = library->getConnection({instance->component.getName(), pin.getName()}, + auto con = library->getConnection({instance->component.getName(), connection.pin.value().getName()}, {name, pinInstance.pin}); if (con.has_value()) { auto busInstance = Application::instance()->addBus(library->getBus(con->getBus()), 0, 0);