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

Method zoomFit

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

Source from the content-addressed store, hash-verified

2841}
2842
2843bool DspNetworkGraph::Actions::zoomFit(DspNetworkGraph& g)
2844{
2845 g.findParentComponentOfClass<ZoomableViewport>()->makeSwapSnapshot(JUCE_LIVE_CONSTANT_OFF(0.998f));
2846
2847 for (auto& n : g.network->getListOfNodesWithType<NodeBase>(false))
2848 n->setValueTreeProperty(PropertyIds::Folded, false);
2849
2850 auto f = [&g]()
2851 {
2852 g.findParentComponentOfClass<ZoomableViewport>()->clearSwapSnapshot();
2853
2854 auto b = g.root->getBoundsInParent();
2855
2856 if(!g.isShowingRootNode())
2857 b = g.getLocalBounds();
2858
2859 g.findParentComponentOfClass<ZoomableViewport>()->zoomToRectangle(b.expanded(UIValues::NodeMargin*2));
2860 g.repaint();
2861 g.grabKeyboardFocus();
2862 };
2863
2864 Timer::callAfterDelay(JUCE_LIVE_CONSTANT_OFF(400), f);
2865
2866 return true;
2867}
2868
2869juce::Identifier NetworkPanel::getProcessorTypeId() const
2870{

Callers

nothing calls this directly

Calls 10

makeSwapSnapshotMethod · 0.80
setValueTreePropertyMethod · 0.80
clearSwapSnapshotMethod · 0.80
getBoundsInParentMethod · 0.80
isShowingRootNodeMethod · 0.80
getLocalBoundsMethod · 0.80
zoomToRectangleMethod · 0.80
grabKeyboardFocusMethod · 0.80
expandedMethod · 0.45
repaintMethod · 0.45

Tested by

no test coverage detected