Skip to content

Commit

Permalink
Merge pull request #605 from HaonRekcef/fix-mainline-starting-with-bl…
Browse files Browse the repository at this point in the history
…ackmove
  • Loading branch information
veloce authored Mar 20, 2024
2 parents 7c7c9d8 + 221cf91 commit a7547e1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/view/analysis/tree_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class _InlineTreeViewState extends ConsumerState<AnalysisTreeView> {
nodes: root.children,
shouldShowComments: shouldShowComments,
inMainline: true,
startMainline: true,
startSideline: false,
initialPath: UciPath.empty,
);
Expand Down Expand Up @@ -169,6 +170,7 @@ class _InlineTreeViewState extends ConsumerState<AnalysisTreeView> {
required ViewNode parent,
required IList<ViewBranch> nodes,
required bool inMainline,
required bool startMainline,
required bool startSideline,
required bool shouldShowComments,
required UciPath initialPath,
Expand All @@ -191,6 +193,7 @@ class _InlineTreeViewState extends ConsumerState<AnalysisTreeView> {
key: currentMove ? currentMoveKey : null,
shouldShowComments: shouldShowComments,
isSideline: !inMainline,
startMainline: startMainline,
startSideline: startSideline,
endSideline: !inMainline && firstChild.children.isEmpty,
),
Expand All @@ -213,6 +216,7 @@ class _InlineTreeViewState extends ConsumerState<AnalysisTreeView> {
nodes: [nodes[i]].lockUnsafe,
shouldShowComments: shouldShowComments,
inMainline: false,
startMainline: false,
startSideline: true,
initialPath: initialPath,
),
Expand All @@ -227,6 +231,7 @@ class _InlineTreeViewState extends ConsumerState<AnalysisTreeView> {
nodes: [nodes[i]].lockUnsafe,
shouldShowComments: shouldShowComments,
inMainline: false,
startMainline: false,
startSideline: true,
initialPath: initialPath,
),
Expand All @@ -242,6 +247,7 @@ class _InlineTreeViewState extends ConsumerState<AnalysisTreeView> {
nodes: firstChild.children,
shouldShowComments: shouldShowComments,
inMainline: inMainline,
startMainline: false,
startSideline: false,
initialPath: newPath,
),
Expand Down Expand Up @@ -278,6 +284,7 @@ class InlineMove extends ConsumerWidget {
required this.isCurrentMove,
required this.isSideline,
super.key,
this.startMainline = false,
this.startSideline = false,
this.endSideline = false,
});
Expand All @@ -289,6 +296,7 @@ class InlineMove extends ConsumerWidget {
final bool shouldShowComments;
final bool isCurrentMove;
final bool isSideline;
final bool startMainline;
final bool startSideline;
final bool endSideline;

Expand Down Expand Up @@ -323,7 +331,7 @@ class InlineMove extends ConsumerWidget {
'${(ply / 2).ceil()}.',
style: indexTextStyle,
)
: (startSideline
: ((startMainline || startSideline)
? Text(
'${(ply / 2).ceil()}...',
style: indexTextStyle,
Expand Down

0 comments on commit a7547e1

Please sign in to comment.