OSDN Git Service

[denncoCreator] expand the rectangle of DCVCPage when a cell is placed outside the...
authortkawata <tkawata@users.sourceforge.jp>
Mon, 24 Dec 2012 05:20:12 +0000 (14:20 +0900)
committertkawata <tkawata@users.sourceforge.jp>
Mon, 24 Dec 2012 05:20:12 +0000 (14:20 +0900)
Source/visualizer/component/dcvccell.cpp
Source/visualizer/component/dcvcpage.cpp
Source/visualizer/component/dcvcpage.h

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)
index 214b5f4..5dc549b 100644 (file)
@@ -187,6 +187,8 @@ void DCVCPage::updateVisiblity(bool linkedCellVisible, bool linkedCellRenderFull
 
 void DCVCPage::prepareChildrenForDraw(bool isAnimationInterval)
 {
+    setWidth(10.0);
+    setDepth(6.0);
     for (int i = 0; i < d_cells.size(); ++i)
     {
         d_cells.at(i)->prepareForDraw(isAnimationInterval);
index ea7c308..acc7302 100644 (file)
@@ -53,6 +53,8 @@ public:
     virtual bool            isResizingArea(float x, float y, float z) const { return false; }
     QString                 getLocationPath() const { return d_locationPath; }
     bool                    getIsModified(DCContainer *container) const;
+    inline float            getWidth() const { return d_width; }
+    inline float            getDepth() const { return d_depth; }
 
     const QList<DCVPageComponent*>* getCells() const { return &d_cells; }
     const QList<DCVPageComponent*>* getCellCodeClasses() const { return &d_cellCodeClasses; }