diff options
Merge branch 'master' of https://github.com/Angeld55/Object-oriented_programming_FMI
1 files changed, 2 insertions, 2 deletions
| -rw-r--r-- | Sem. 13/ShapeCollection/ShapeCollection.cpp | 4 |
diff --git a/Sem. 13/ShapeCollection/ShapeCollection.cpp b/Sem. 13/ShapeCollection/ShapeCollection.cpp index babe36d..1239fbf 100644 --- a/Sem. 13/ShapeCollection/ShapeCollection.cpp +++ b/Sem. 13/ShapeCollection/ShapeCollection.cpp @@ -13,7 +13,7 @@ void ShapeCollection::free() } void ShapeCollection::copyFrom(const ShapeCollection& other) { - shapes = new Shape* [other.shapesCount]; + shapes = new Shape* [other.capacity]; shapesCount = other.shapesCount; capacity = other.capacity; @@ -99,4 +99,4 @@ double ShapeCollection::getIfPointInShapeByIndex(size_t ind, int x, int y) const if (ind >= shapesCount) throw std::out_of_range("Out of range in shapes collection"); return shapes[ind]->isPointIn(x, y); -}
\ No newline at end of file +} |
