MCPcopy Create free account
hub / github.com/christophhart/HISE / resized

Method resized

hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.cpp:488–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488void 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
543struct RootUndoAction: public UndoableAction
544{

Callers 1

setSelectedMethod · 0.45

Calls 15

withSizeKeepingCentreMethod · 0.80
reducedMethod · 0.80
getBoundsWithoutHelpMethod · 0.80
isHelpBelowMethod · 0.80
getHeightFunction · 0.50
setVisibleMethod · 0.45
removeFromTopMethod · 0.45
removeFromLeftMethod · 0.45
setBoundsMethod · 0.45
sizeMethod · 0.45
getWidthMethod · 0.45
getPositionInCanvasMethod · 0.45

Tested by

no test coverage detected