diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-06 20:15:22 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-06 20:15:22 -0500 |
commit | f83b4a60b32f88720b583bd2b4a4d91995d0df77 (patch) | |
tree | 2f6f7908ecdde390d6aeb2a08fc443a987cecf98 /app/assets | |
parent | 960984443e224bd8565f559d842f519e45d778da (diff) | |
download | wittle-f83b4a60b32f88720b583bd2b4a4d91995d0df77.tar.gz wittle-f83b4a60b32f88720b583bd2b4a4d91995d0df77.tar.bz2 wittle-f83b4a60b32f88720b583bd2b4a4d91995d0df77.zip |
fixed side endpoints with parallel symmetry
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/wittle/trace2.js | 18 |
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 |