diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-06-07 18:42:50 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-06-07 18:42:50 +0200 |
| commit | 7d753ae2d82592e09e04e4ecf11df976a2d187fd (patch) | |
| tree | 4bee36d2432bef8793c366c96e4a7a5ed905df06 /src/CGEditor.cpp | |
| parent | 3594a12bb4a4bc8724a6c3d592487a66f586df20 (diff) | |
Diffstat (limited to 'src/CGEditor.cpp')
| -rw-r--r-- | src/CGEditor.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/CGEditor.cpp b/src/CGEditor.cpp index cf405db..1cdb012 100644 --- a/src/CGEditor.cpp +++ b/src/CGEditor.cpp @@ -8,6 +8,7 @@ CGEditor::CGEditor() { MT = new MoveTable(&status); MA = new Margin(&status); ME = new Menu(&status); + TF=nullptr; // Default Standard NagTable: https://en.wikipedia.org/wiki/Numeric_Annotation_Glyphs status.NagTable[0]=""; status.NagTable[1]="!"; @@ -81,6 +82,14 @@ void CGEditor::Draw() { MA->Refresh(); MT->Refresh(); MA->DrawMargin(MT->GetVariationsMarging()); + // Check if we need to focus on a specific move: + if(TF!=nullptr){ + double X,Y; + MT->GetMoveXY(TF,X,Y); + SBH->Focus(X+status.MoveWidth); + SBV->Focus(Y+status.MoveHeight); + TF=nullptr; + } SBV->Refresh(); SBH->Refresh(); ME->Refresh(); @@ -181,9 +190,6 @@ std::uint8_t CGEditor::GetNAGId(const std::string& symbol) const{ } void CGEditor::FocusOnMove(CMI::HalfMove* move){ - double X,Y; - MT->GetMoveXY(move,X,Y); - SBH->Focus(X+status.MoveWidth); - SBV->Focus(Y+status.MoveHeight); + TF=move; } } // namespace cgeditor |
