From bb0dc575e514a1a90464946aa083a5c8555e41e4 Mon Sep 17 00:00:00 2001 From: Стоян Златев <47269030+Tony5768@users.noreply.github.com> Date: Sun, 5 Jun 2022 10:57:54 +0300 Subject: Update ShapeCollection.cpp --- Sem. 13/ShapeCollection/ShapeCollection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +} -- cgit v1.3.1-23-gd82d