Skip to content

Commit

Permalink
Fixed proof=>draw=>proof mode parity color bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanR712 committed May 11, 2024
1 parent 73e9ac4 commit cddad59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/SharedToolUtils/DrawUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,12 @@ function redrawCut(incomingNode: CutNode, color?: string): void {
2 * Math.PI
);
ctx.globalCompositeOperation = "destination-over";

ctx.fillStyle =
TreeContext.tree.getLevel(incomingNode) % 2 === 0 ||
TreeContext.getLastProofStep().tree.getLevel(incomingNode) % 2 === 0
(TreeContext.modeState === "Draw" &&
TreeContext.tree.getLevel(incomingNode) % 2 === 0) ||
(TreeContext.modeState === "Proof" &&
TreeContext.currentProofStep!.tree.getLevel(incomingNode) % 2 === 0)
? cssVar("--canvas-odd-bg")
: cssVar("--canvas-bg");
ctx.fill();
Expand Down

0 comments on commit cddad59

Please sign in to comment.