Skip to content

Commit e0a232c

Browse files
committed
Globally restrict board sizes to a max of 50 to avoid accidental crashes.
1 parent 97e74ad commit e0a232c

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.5.1] - 2024-10-24
9+
10+
### Changed
11+
12+
- Height and width of all boards is restricted to 50 to avoid accidental crashes. You can still get larger boards by hand adjusting the JSON and importing it, but the input boxes won't allow it.
13+
814
## [1.5.0] - 2024-09-21
915

1016
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "abstractplay-designer",
33
"private": true,
4-
"version": "1.5.0",
4+
"version": "1.5.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src/components/Board.svelte

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@
293293
294294
const updatePreview = () => {
295295
if (whichWidth === "minmax") {
296+
if ($state.board.minWidth > 50) {
297+
$state.board.minWidth = 50;
298+
}
299+
if ($state.board.maxWidth > 50) {
300+
$state.board.maxWidth = 50;
301+
}
296302
// if ($state.board.minWidth < 2) {
297303
// $state.board.minWidth = 2;
298304
// }
@@ -303,6 +309,12 @@
303309
$state.board.maxWidth = $state.board.minWidth * 2 - 1;
304310
}
305311
} else if (whichWidth === "abs") {
312+
if ($state.board.width > 50) {
313+
$state.board.width = 50;
314+
}
315+
if ($state.board.height > 50) {
316+
$state.board.height = 50;
317+
}
306318
if (symmetryLocked) {
307319
$state.board.height = $state.board.width;
308320
}
@@ -423,6 +435,7 @@
423435
id="setWidth"
424436
type="number"
425437
min="1"
438+
max="50"
426439
bind:value="{$state.board.width}"
427440
on:input="{updatePreview}"
428441
/>
@@ -438,6 +451,7 @@
438451
id="setHeight"
439452
type="number"
440453
min="1"
454+
max="50"
441455
bind:value="{$state.board.height}"
442456
on:input="{updatePreview}"
443457
readonly="{symmetryLocked}"
@@ -468,6 +482,7 @@
468482
id="setMinWidth"
469483
type="number"
470484
min="1"
485+
max="50"
471486
bind:value="{$state.board.minWidth}"
472487
on:input="{updatePreview}"
473488
/>
@@ -484,6 +499,7 @@
484499
id="setMaxWidth"
485500
type="number"
486501
min="1"
502+
max="50"
487503
bind:value="{$state.board.maxWidth}"
488504
on:input="{updatePreview}"
489505
readonly="{symmetryLocked}"

0 commit comments

Comments
 (0)