From 5ceb3eafc405859f5e588118158cb9e9dbd00485 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 7 Jun 2023 09:21:45 +0200 Subject: [PATCH] Debug CGEditor --- src/components/MoveTable.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/MoveTable.cpp b/src/components/MoveTable.cpp index 88767b1..b92cf76 100644 --- a/src/components/MoveTable.cpp +++ b/src/components/MoveTable.cpp @@ -351,7 +351,14 @@ std::uint32_t MoveTable::DrawVariations(CMI::HalfMove *m, std::uint32_t line, } void MoveTable::GetMoveXY(CMI::HalfMove* m, double &X, double &Y){ - X=MovesStates.at(m).Bound.x; - Y=MovesStates.at(m).Bound.y; + if(MovesStates.count(m)>0){ + X=MovesStates[m].Bound.x; + Y=MovesStates[m].Bound.y; + } + else { + // Being predictable: + X=0; + Y=0; + } } } // namespace cgeditor \ No newline at end of file