@@ -85,7 +85,11 @@ NetworkEditor::NetworkEditor(const NetworkEditorParameters& params, QWidget* par
8585
8686 connect (scene_, SIGNAL (changed (const QList<QRectF>&)), this , SIGNAL (sceneChanged (const QList<QRectF>&)));
8787
88- setSceneRect (QRectF (0 , 0 , sceneWidth, sceneHeight));
88+ // old
89+ setSceneRect (QRectF (-1000 , -1000 , 2000 , 2000 ));
90+ centerOn (100 , 100 );
91+ // new
92+ // setSceneRect(QRectF(0, 0, sceneWidth, sceneHeight));
8993 // centerOn(sceneWidth / 2, sceneHeight / 4);
9094
9195 setMouseAsDragMode ();
@@ -142,6 +146,8 @@ boost::shared_ptr<NetworkEditorControllerGuiProxy> NetworkEditor::getNetworkEdit
142146
143147QPointF NetworkBoundaries::keepInScene (const QPointF& p)
144148{
149+ return p;
150+ #if 0 //post-ibbm
145151 auto adjusted = p;
146152 if (adjusted.x() < 0)
147153 adjusted.setX(0);
@@ -155,6 +161,7 @@ QPointF NetworkBoundaries::keepInScene(const QPointF& p)
155161
156162 return adjusted;
157163 //return QPointF(static_cast<int>(p.x()) % sceneWidth, static_cast<int>(p.y()) % sceneHeight);
164+ #endif
158165}
159166
160167void NetworkEditor::addModuleWidget (const std::string& name, ModuleHandle module , const ModuleCounter& count)
@@ -595,7 +602,7 @@ void NetworkEditor::copy()
595602 auto selected = scene_->selectedItems ();
596603 if (selected.empty ())
597604 return ;
598-
605+
599606 auto modSelected = [&selected](ModuleHandle mod)
600607 {
601608 for (const auto & item : selected)
@@ -1186,9 +1193,8 @@ SubnetworksHandle NetworkEditor::dumpSubnetworks(ModuleFilter modFilter) const
11861193 return subnets;
11871194}
11881195
1189- void NetworkEditor::updateModulePositions (const ModulePositions& modulePositions, bool selectAll )
1196+ QPointF NetworkEditor::getModulePositionAdjustment (const ModulePositions& modulePositions)
11901197{
1191- QPointF furthestFromOrigin (0 ,0 );
11921198 std::vector<QPointF> positions;
11931199 Q_FOREACH (QGraphicsItem* item, scene_->items ())
11941200 {
@@ -1212,7 +1218,12 @@ void NetworkEditor::updateModulePositions(const ModulePositions& modulePositions
12121218 adjustment = { minX.x (), minY.y () };
12131219 }
12141220 }
1221+ return adjustment;
1222+ }
12151223
1224+ void NetworkEditor::updateModulePositions (const ModulePositions& modulePositions, bool selectAll)
1225+ {
1226+ const auto adjustment = QPointF (); // TODO: after ibbm, work on resizing of network editor space
12161227 Q_FOREACH (QGraphicsItem* item, scene_->items ())
12171228 {
12181229 if (auto w = dynamic_cast <ModuleProxyWidget*>(item))
0 commit comments