Skip to content

Commit c178d21

Browse files
committed
Change board appearance
1 parent 6991e7d commit c178d21

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

src/variety/diamond.js

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341

342342
paint: function() {
343343
this.drawBGCells();
344-
this.drawGrid();
344+
this.drawBaseMarks();
345345

346346
this.drawQuesCells();
347347
this.drawQuesNumbers();
@@ -354,6 +354,46 @@
354354
this.drawTarget();
355355
},
356356

357+
drawBaseMarks: function() {
358+
var bd = this.board;
359+
var g = this.vinc("cross_mark", "auto", true);
360+
g.strokeStyle = this.quescolor;
361+
g.fillStyle = this.quescolor;
362+
g.lineWidth = 1;
363+
364+
var size = this.cw / 10;
365+
var clist = this.range.crosses;
366+
for (var i = 0; i < clist.length; i++) {
367+
var cross = clist[i];
368+
g.vid = "x_cm_" + cross.id;
369+
370+
if (
371+
cross.bx === bd.minbx ||
372+
cross.bx === bd.maxbx ||
373+
cross.by === bd.minby ||
374+
cross.by === bd.maxby
375+
) {
376+
g.vhide();
377+
continue;
378+
}
379+
380+
var px = cross.bx * this.bw,
381+
py = cross.by * this.bh;
382+
383+
if ((cross.bx + cross.by) & 2) {
384+
g.beginPath();
385+
g.moveTo(px - size, py);
386+
g.lineTo(px + size, py);
387+
g.moveTo(px, py - size);
388+
g.lineTo(px, py + size);
389+
g.closePath();
390+
g.stroke();
391+
} else {
392+
g.fillCircle(px, py, size / 2);
393+
}
394+
}
395+
},
396+
357397
getQuesCellColor: function(cell) {
358398
if (cell.qnum === -1) {
359399
return null;

0 commit comments

Comments
 (0)