From 2a4a20beefa533730d85a75bbc2dc6676fa247b5 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 5 Jun 2023 13:48:29 +0200 Subject: Introduce move based focusing --- src/components/MoveTable.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/components/MoveTable.cpp') diff --git a/src/components/MoveTable.cpp b/src/components/MoveTable.cpp index 4878275..88767b1 100644 --- a/src/components/MoveTable.cpp +++ b/src/components/MoveTable.cpp @@ -69,6 +69,9 @@ std::uint32_t MoveTable::UpdateMoves(CMI::HalfMove *m, std::uint32_t line, move_bound.text = m->GetSAN(); move_bound.ShouldApplyScroll = true; bool isMouseOver = IsMouseOver(move_bound); + // Save in cache: + MovesStates[m].Bound=move_bound; + MovesStates[m].Line=line; //---------- Update current focus move ---------- if (isMouseOver) { @@ -346,4 +349,9 @@ std::uint32_t MoveTable::DrawVariations(CMI::HalfMove *m, std::uint32_t line, } return (line); } + +void MoveTable::GetMoveXY(CMI::HalfMove* m, double &X, double &Y){ + X=MovesStates.at(m).Bound.x; + Y=MovesStates.at(m).Bound.y; +} } // namespace cgeditor \ No newline at end of file -- cgit v1.2.3