| 486 | } |
| 487 | |
| 488 | void DspNetworkGraph::resized() |
| 489 | { |
| 490 | if (root != nullptr) |
| 491 | { |
| 492 | ScopedValueSetter<bool> svs(dynamic_cast<NodeContainer*>(getCurrentRootNode())->forceNoLock, true); |
| 493 | |
| 494 | auto b = getLocalBounds(); |
| 495 | |
| 496 | rootUndoButtons.setVisible(!isShowingRootNode()); |
| 497 | |
| 498 | if(!isShowingRootNode()) |
| 499 | { |
| 500 | auto bcArea = b.removeFromTop(UIValues::ZoomOffset); |
| 501 | |
| 502 | bcArea.removeFromLeft(UIValues::NodeMargin); |
| 503 | |
| 504 | rootUndoButtons.setBounds(bcArea.removeFromLeft(UIValues::ZoomOffset)); |
| 505 | rootUndoButtons.resized(); |
| 506 | |
| 507 | for(int i = breadcrumbs.size() - 1; i >= 0; i--) |
| 508 | { |
| 509 | auto bc = breadcrumbs[i]; |
| 510 | auto w = bc->getWidth(); |
| 511 | bc->setBounds(bcArea.removeFromLeft(w).withSizeKeepingCentre(w, 32)); |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | b = b.reduced(UIValues::NodeMargin); |
| 516 | |
| 517 | auto nb = getCurrentRootNode()->getPositionInCanvas({ UIValues::NodeMargin, UIValues::NodeMargin }); |
| 518 | |
| 519 | if(!isShowingRootNode()) |
| 520 | nb = getCurrentRootNode()->getBoundsWithoutHelp(nb); |
| 521 | |
| 522 | nb = b.withSizeKeepingCentre(nb.getWidth(), nb.getHeight()); |
| 523 | |
| 524 | if(!isShowingRootNode()) |
| 525 | { |
| 526 | auto& hm = getCurrentRootNode()->getHelpManager(); |
| 527 | |
| 528 | if(!hm.isHelpBelow()) |
| 529 | { |
| 530 | nb = nb.withX(UIValues::NodeMargin); |
| 531 | } |
| 532 | else |
| 533 | { |
| 534 | nb = nb.withY(b.getY()); |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | root->setBounds(nb); |
| 539 | root->resized(); |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | struct RootUndoAction: public UndoableAction |
| 544 | { |
no test coverage detected