Skip to content

Commit 4c5ec84

Browse files
committed
Adjust position a bit
1 parent fd8751e commit 4c5ec84

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Interface/Application/ModuleWidget.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,9 @@ bool ModuleWidget::guiVisible() const
542542

543543
void ModuleWidget::fillReplaceWithMenu()
544544
{
545+
if (deleting_)
546+
return;
547+
545548
auto menu = getReplaceWithMenu();
546549
menu->clear();
547550
LOG_DEBUG("Filling menu for " << theModule_->get_module_name() << std::endl);

src/Interface/Application/Subnetworks.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ void NetworkEditor::initializeSubnet(const QString& name, const ModuleId& mid, N
135135
subnet->parentNetwork_ = this;
136136
subnet->setNetworkEditorController(getNetworkEditorController());
137137

138+
//subnet->setSceneRect(QRectF(-100, -100, 200, 200));
139+
138140
for (auto& item : childrenNetworkItems_[name])
139141
subnet->scene_->addItem(item);
140142

@@ -239,6 +241,12 @@ void NetworkEditor::makeSubnetwork()
239241
proxy->setScale(1.6);
240242
proxy->setToolTip(tooltipPic);
241243

244+
auto size = proxy->getModuleWidget()->size();
245+
auto pos = rect.center();
246+
pos.rx() -= size.width() / 2;
247+
pos.ry() -= size.height() / 2;
248+
proxy->setPos(pos);
249+
242250
childrenNetworkItems_[name] = items;
243251

244252
addSubnetChild(name, subnetModule->get_id());

0 commit comments

Comments
 (0)