about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/wittle/trace2.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/assets/javascripts/wittle/trace2.js b/app/assets/javascripts/wittle/trace2.js index 9602a41..a3ef343 100644 --- a/app/assets/javascripts/wittle/trace2.js +++ b/app/assets/javascripts/wittle/trace2.js
@@ -62,11 +62,21 @@ class BoundingBox {
62 this.y1 = this.raw.y1 62 this.y1 = this.raw.y1
63 this.y2 = this.raw.y2 63 this.y2 = this.raw.y2
64 64
65 // Check for endpoint adjustment 65 // Check for endpoint adjustment.
66 if (this.sym !== true) { 66 // Pretend it's not an endpoint if the sym cell isn't an endpoint.
67 var cell = data.puzzle.getCell(data.pos.x, data.pos.y) 67 if (data.puzzle.symType != SYM_TYPE_NONE) {
68 var cell1 = data.puzzle.getCell(data.pos.x, data.pos.y)
69 var cell2 = data.puzzle.getSymmetricalCell(data.pos.x, data.pos.y)
70
71 if (cell1.end !== cell2.end) {
72 var cell = {'end': 'none'}
73 } else if (this.sym !== true) {
74 var cell = cell1
75 } else {
76 var cell = cell2
77 }
68 } else { 78 } else {
69 var cell = data.puzzle.getSymmetricalCell(data.sym.x, data.sym.y) 79 var cell = data.puzzle.getCell(data.pos.x, data.pos.y)
70 } 80 }
71 if (cell.end === 'left') { 81 if (cell.end === 'left') {
72 this.x1 -= 24 82 this.x1 -= 24