Skip to content

Commit 6991e7d

Browse files
committed
Hide adjacent crosses instead of erasing
1 parent ac4ab3b commit 6991e7d

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/variety/diamond.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,8 @@
188188
this.dotCells().each(function(cell) {
189189
cell.setQsub(0);
190190
});
191-
for (var dir in this.adjacent) {
192-
var other = this.adjacent[dir];
193-
if (other.qsub) {
194-
other.setQsub(0);
195-
other.draw();
196-
}
197-
}
198191
}
192+
this.drawaround();
199193
},
200194
dotCells: function() {
201195
var bx = this.bx,
@@ -401,12 +395,13 @@
401395

402396
g.vid = "s_dot_" + dot.id;
403397
var outline = this.getDiamondColor(dot);
404-
if (dot.qans === 1) {
398+
var value = dot.getDiamond();
399+
if (value === 1) {
405400
g.lineWidth = (1 + this.cw / 20) | 0;
406401
g.fillStyle = outline;
407402
g.setOffsetLinePath(px, py, -bw, 0, 0, bh, bw, 0, 0, -bh, true);
408403
g.fill();
409-
} else if (dot.qsub === 1) {
404+
} else if (value === 2 && !dot.overlapsDiamond(true)) {
410405
g.lineWidth = (1 + this.cw / 30) | 0;
411406
g.strokeStyle = outline;
412407
g.beginPath();

test/script/diamond.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ui.debug.addDebugData("diamond", {
7171
},
7272
{
7373
input: ["playmode,diamond", "mouse,right,6,2", "mouse,right,6,4"],
74-
result: "pzprv3/diamond/3/4/. . . . /. . . . /. . . . /1 0 0 /0 0 1 /"
74+
result: "pzprv3/diamond/3/4/. . . . /. . . . /. . . . /1 0 0 /0 2 1 /"
7575
}
7676
]
7777
});

0 commit comments

Comments
 (0)