OSDN Git Service

[denncoCreator] expand the rectangle of DCVCPage when a cell is placed outside the...
[dennco/denncoCreator.git] / Source / visualizer / component / dcvccell.cpp
index ea4ed49..4eed67b 100644 (file)
@@ -95,6 +95,21 @@ void DCVCCell::prepareChildrenForDraw(bool isAnimationInterval)
         ++it;
     }
     d_owner->getAxon()->getVComponent()->prepareForDraw(isAnimationInterval);
+
+    float s = d_owner->getViewSize();
+    float ew = fabs(getPageX()) * 2 + s + 0.75;
+    float ed = fabs(getPageY()) * 2 + s + 0.75;
+
+    DCVCPage *page = getPageBelonging();
+    if (ew > page->getWidth())
+    {
+        page->setWidth(ew);
+    }
+
+    if (ed > page->getDepth())
+    {
+        page->setDepth(ed);
+    }
 }
 
 void DCVCCell::drawChildren(bool isAnimationInterval)