Skip to content

Commit 46f96de

Browse files
committed
rerender関数のセルサイズの更新ロジックを削除
1 parent 9d2e202 commit 46f96de

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

src/iframe/life-game.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let patternWidth = 0;
1010
let previewCells = [];
1111

1212
//盤面の大きさ
13-
let boardSize = 20;
13+
const boardSize = 20;
1414
const cellSize = 450 / boardSize;
1515

1616
//セルの色
@@ -168,14 +168,6 @@ function rerender() {
168168
if (currentCellColor !== expectedCellColor) {
169169
button.style.backgroundColor = expectedCellColor;
170170
}
171-
172-
// セルサイズの更新
173-
const currentCellsize = button.style.width;
174-
const expectedCellsize = `${cellSize}px`;
175-
if (currentCellsize !== expectedCellsize) {
176-
button.style.width = expectedCellsize;
177-
button.style.height = expectedCellsize;
178-
}
179171
}
180172
}
181173
}

src/lib/assets/life-game-rules/lifespan.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let patternWidth = 0;
1010
let previewCells = [];
1111

1212
//変数設定
13-
let boardSize = 20; //盤面の大きさ(20x20)
13+
const boardSize = 20; //盤面の大きさ(20x20)
1414
const cellSize = 450 / boardSize; //セルの大きさ(px)
1515
const maxLifespan = 2; // セルの最大寿命
1616

@@ -186,14 +186,6 @@ function rerender() {
186186
if (currentCellColor !== expectedCellColor) {
187187
button.style.backgroundColor = expectedCellColor;
188188
}
189-
190-
// セルサイズの更新
191-
const currentCellsize = button.style.width;
192-
const expectedCellsize = `${cellSize}px`;
193-
if (currentCellsize !== expectedCellsize) {
194-
button.style.width = expectedCellsize;
195-
button.style.height = expectedCellsize;
196-
}
197189
}
198190
}
199191
}

src/lib/assets/life-game-rules/probabilistics.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let patternWidth = 0;
1010
let previewCells = [];
1111

1212
//変数設定
13-
let boardSize = 20; //盤面の大きさ(20x20)
13+
const boardSize = 20; //盤面の大きさ(20x20)
1414
const cellSize = 450 / boardSize; //セルの大きさ(px)
1515

1616
// around: 周囲の生きたセル数 self: 自身が生きているかどうか
@@ -166,14 +166,6 @@ function rerender() {
166166
if (currentCellColor !== expectedCellColor) {
167167
button.style.backgroundColor = expectedCellColor;
168168
}
169-
170-
// セルサイズの更新
171-
const currentCellsize = button.style.width;
172-
const expectedCellsize = `${cellSize}px`;
173-
if (currentCellsize !== expectedCellsize) {
174-
button.style.width = expectedCellsize;
175-
button.style.height = expectedCellsize;
176-
}
177169
}
178170
}
179171
}

0 commit comments

Comments
 (0)