| 2841 | } |
| 2842 | |
| 2843 | bool 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 | |
| 2869 | juce::Identifier NetworkPanel::getProcessorTypeId() const |
| 2870 | { |
nothing calls this directly
no test coverage detected