| @@ -174,7 +174,7 @@ public: | |||||
| int getRowNumberOfComponent (Component* const rowComponent) const noexcept | int getRowNumberOfComponent (Component* const rowComponent) const noexcept | ||||
| { | { | ||||
| const int index = getIndexOfChildComponent (rowComponent); | |||||
| const int index = getViewedComponent()->getIndexOfChildComponent (rowComponent); | |||||
| const int num = rows.size(); | const int num = rows.size(); | ||||
| for (int i = num; --i >= 0;) | for (int i = num; --i >= 0;) | ||||
| @@ -196,15 +196,16 @@ public: | |||||
| { | { | ||||
| hasUpdated = false; | hasUpdated = false; | ||||
| const int newX = getViewedComponent()->getX(); | |||||
| int newY = getViewedComponent()->getY(); | |||||
| Component& content = *getViewedComponent(); | |||||
| const int newX = content.getX(); | |||||
| int newY = content.getY(); | |||||
| const int newW = jmax (owner.minimumRowWidth, getMaximumVisibleWidth()); | const int newW = jmax (owner.minimumRowWidth, getMaximumVisibleWidth()); | ||||
| const int newH = owner.totalItems * owner.getRowHeight(); | const int newH = owner.totalItems * owner.getRowHeight(); | ||||
| if (newY + newH < getMaximumVisibleHeight() && newH > getMaximumVisibleHeight()) | if (newY + newH < getMaximumVisibleHeight() && newH > getMaximumVisibleHeight()) | ||||
| newY = getMaximumVisibleHeight() - newH; | newY = getMaximumVisibleHeight() - newH; | ||||
| getViewedComponent()->setBounds (newX, newY, newW, newH); | |||||
| content.setBounds (newX, newY, newW, newH); | |||||
| if (makeSureItUpdatesContent && ! hasUpdated) | if (makeSureItUpdatesContent && ! hasUpdated) | ||||
| updateContents(); | updateContents(); | ||||
| @@ -214,11 +215,12 @@ public: | |||||
| { | { | ||||
| hasUpdated = true; | hasUpdated = true; | ||||
| const int rowH = owner.getRowHeight(); | const int rowH = owner.getRowHeight(); | ||||
| Component& content = *getViewedComponent(); | |||||
| if (rowH > 0) | if (rowH > 0) | ||||
| { | { | ||||
| const int y = getViewPositionY(); | const int y = getViewPositionY(); | ||||
| const int w = getViewedComponent()->getWidth(); | |||||
| const int w = content.getWidth(); | |||||
| const int numNeeded = 2 + getMaximumVisibleHeight() / rowH; | const int numNeeded = 2 + getMaximumVisibleHeight() / rowH; | ||||
| rows.removeRange (numNeeded, rows.size()); | rows.removeRange (numNeeded, rows.size()); | ||||
| @@ -227,7 +229,7 @@ public: | |||||
| { | { | ||||
| RowComponent* newRow = new RowComponent (owner); | RowComponent* newRow = new RowComponent (owner); | ||||
| rows.add (newRow); | rows.add (newRow); | ||||
| getViewedComponent()->addAndMakeVisible (newRow); | |||||
| content.addAndMakeVisible (newRow); | |||||
| } | } | ||||
| firstIndex = y / rowH; | firstIndex = y / rowH; | ||||
| @@ -247,10 +249,10 @@ public: | |||||
| } | } | ||||
| if (owner.headerComponent != nullptr) | if (owner.headerComponent != nullptr) | ||||
| owner.headerComponent->setBounds (owner.outlineThickness + getViewedComponent()->getX(), | |||||
| owner.headerComponent->setBounds (owner.outlineThickness + content.getX(), | |||||
| owner.outlineThickness, | owner.outlineThickness, | ||||
| jmax (owner.getWidth() - owner.outlineThickness * 2, | jmax (owner.getWidth() - owner.outlineThickness * 2, | ||||
| getViewedComponent()->getWidth()), | |||||
| content.getWidth()), | |||||
| owner.headerComponent->getHeight()); | owner.headerComponent->getHeight()); | ||||
| } | } | ||||