Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 13 / ShapeCollection / ShapeCollection.cpp
diff options
context:
space:
mode:
Commitbb0dc575e514a1a90464946aa083a5c8555e41e4 (patch)
Author
 Стоян Златев <47269030+Tony5768@users.noreply.github.com>
2022-06-05 10:57:54 +0300
Committer
 GitHub <noreply@github.com>
2022-06-05 10:57:54 +0300
Files3757d4e32c1ba3237f49f77211c17f9381deb978 /Sem. 13/ShapeCollection/ShapeCollection.cpp
Object-oriented_programming_FMI-bb0dc575e514a1a90464946aa083a5c8555e41e4.tar
Object-oriented_programming_FMI-bb0dc575e514a1a90464946aa083a5c8555e41e4.tar.gz
Object-oriented_programming_FMI-bb0dc575e514a1a90464946aa083a5c8555e41e4.zip
Parent2ff35217aae6465dfc0b8ff84bb4e4b5cd3f4fe5 (diff)
Update ShapeCollection.cpp
1 files changed, 2 insertions, 2 deletions
-rw-r--r--Sem. 13/ShapeCollection/ShapeCollection.cpp4
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
+}