Fixed pin selection
This commit is contained in:
parent
09991904e9
commit
ae2a3c64ef
|
@ -175,13 +175,14 @@ namespace display {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto pinInstance = domain::ConnectionComponent{connection.componentInstance.value()->name, connection.pin.value().getName()};
|
auto pinInstance = domain::ConnectionComponent{connection.componentInstance.value()->name, connection.pin.value().getName()};
|
||||||
auto rect = pins[pinInstance]->boundingRect();
|
auto pin = pins[pinInstance]->getPin().getDisplayPin();
|
||||||
rect.setX(pins[pinInstance]->scenePos().x());
|
auto position = pins[pinInstance]->getComponentInstance()->position;
|
||||||
rect.setY(pins[pinInstance]->scenePos().y());
|
|
||||||
|
auto rect = QRectF(position.first + pin.x, position.second + pin.y, pin.w, pin.h);
|
||||||
|
|
||||||
if (rect.contains(endPoint)) {
|
if (rect.contains(endPoint)) {
|
||||||
auto name = components[pinInstance.component]->getComponentInstance()->component.getName();
|
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});
|
{name, pinInstance.pin});
|
||||||
if (con.has_value()) {
|
if (con.has_value()) {
|
||||||
auto busInstance = Application::instance()->addBus(library->getBus(con->getBus()), 0, 0);
|
auto busInstance = Application::instance()->addBus(library->getBus(con->getBus()), 0, 0);
|
||||||
|
|
Loading…
Reference in New Issue