aboutsummaryrefslogtreecommitdiff
path: root/src/components/MoveTable.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-06-05 13:48:29 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-06-05 13:48:29 +0200
commit2a4a20beefa533730d85a75bbc2dc6676fa247b5 (patch)
tree987bea897030e3f5a6114f30acccaef56bb01768 /src/components/MoveTable.cpp
parent298714449a7c19c7a0f85d2f06305432f8a5251c (diff)
Introduce move based focusing
Diffstat (limited to 'src/components/MoveTable.cpp')
-rw-r--r--src/components/MoveTable.cpp8
1 files changed, 8 insertions, 0 deletions
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