Skip to content

Commit

Permalink
fixed an edge case for lineox composite mode
Browse files Browse the repository at this point in the history
  • Loading branch information
swaroopg92 committed Jul 20, 2024
1 parent 65f02d3 commit 63a05cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/js/class_p.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ class Puzzle {
this.replaycutoff = 60 * 60 * 1000; // 60 minutes
this.surface_2_edge_types = ['pentominous', 'araf', 'spiralgalaxies', 'fillomino', 'compass'];
this.isReplay = false;
this.linedrawing = false; // Used for lineox composite mode
}

reset() {
Expand Down Expand Up @@ -10167,6 +10168,9 @@ class Puzzle {
array = "line";
var key = (Math.min(num, this.last)).toString() + "," + (Math.max(num, this.last)).toString();
this.re_line(array, key, line_style);

// To track if user is drawing line or just placing symbols
this.linedrawing = true;
}
this.last = num;
this.redraw();
Expand All @@ -10183,7 +10187,7 @@ class Puzzle {
secondsymbol = [1, "ox_E", 2];
}

if (this.point[num].type === 0 && this.last === num && this.first === num) {
if (this.point[num].type === 0 && this.last === num && this.first === num && !this.linedrawing) {
if (!this[this.mode.qa].symbol[num]) {
this.record("symbol", num);
this[this.mode.qa].symbol[num] = firstsymbol;
Expand All @@ -10199,6 +10203,7 @@ class Puzzle {
}
}
this.drawing_mode = -1;
this.linedrawing = false;
this.first = -1;
this.last = -1;
this.redraw();
Expand Down

0 comments on commit 63a05cd

Please sign in to comment.