fix : UI flickering
This commit is contained in:
@@ -85,8 +85,8 @@ export const getEvaluationBarValue = (
|
||||
): { whiteBarPercentage: number; label: string } => {
|
||||
if (bestLine.mate) {
|
||||
return {
|
||||
whiteBarPercentage: whiteToPlay ? 100 : 0,
|
||||
label: `M${bestLine.mate}`,
|
||||
whiteBarPercentage: whiteToPlay && bestLine.mate > 0 ? 100 : 0,
|
||||
label: `M${Math.abs(bestLine.mate)}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ export abstract class UciEngine {
|
||||
parsedResults.lines = parsedResults.lines.map((line) => ({
|
||||
...line,
|
||||
cp: line.cp ? -line.cp : line.cp,
|
||||
mate: line.mate ? -line.mate : line.mate,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user