From 1d0947770bcbbea4ed3529f49968b0d411956daf Mon Sep 17 00:00:00 2001 From: Martin Euzenat Date: Thu, 25 Jan 2024 00:37:41 -0500 Subject: [PATCH] fix de la position de drawing de SetPattern --- GPA675Lab1GOL/GOLTeamH.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPA675Lab1GOL/GOLTeamH.cpp b/GPA675Lab1GOL/GOLTeamH.cpp index 427b316..290940d 100644 --- a/GPA675Lab1GOL/GOLTeamH.cpp +++ b/GPA675Lab1GOL/GOLTeamH.cpp @@ -426,8 +426,8 @@ bool GOLTeamH::setFromPattern(std::string const& pattern) } pos++; - size_t centerX = mData.width() / 2; - size_t centerY = mData.height() / 2; + size_t centerX = mData.width() / 2 - width/2; + size_t centerY = mData.height() / 2 - height/2; // Remplissage de la grille aux positions spécifiées par le patron for (size_t y = 0; y < height; ++y) {