File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -58,19 +58,19 @@ class LayoutOptimizer::Impl
5858 {
5959 juzzlin::L ().info () << " Initializing LayoutOptimizer: aspectRatio=" << aspectRatio << " , minEdgeLength=" << minEdgeLength;
6060
61- if (!m_mindMapData->graph ().numNodes ()) {
61+ const auto nodes = m_mindMapData->graph ().getNodes ();
62+ if (nodes.empty ()) {
6263 juzzlin::L ().info () << " No nodes" ;
6364 return false ;
6465 }
6566
6667 double area = 0 ;
67- for (auto && node : m_mindMapData-> graph (). getNodes () ) {
68+ for (auto && node : nodes ) {
6869 area += (node->size ().width () + minEdgeLength) * (node->size ().height () + minEdgeLength);
6970 }
7071
7172 // Build initial layout
7273
73- auto nodes = m_mindMapData->graph ().getNodes ();
7474 const auto originalLayoutDimensions = calculateLayoutDimensions (nodes);
7575 juzzlin::L ().info () << " Area: " << originalLayoutDimensions.height () * originalLayoutDimensions.width ();
7676 const double height = std::sqrt (area / aspectRatio);
You can’t perform that action at this time.
0 commit comments