fix: set max gap to scale/2 - 1

This commit is contained in:
DarkCat09 2024-07-11 20:17:48 +04:00
parent 326844fe1c
commit 4ed6418c28
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

View file

@ -64,7 +64,9 @@ addEventListener('DOMContentLoaded', () => {
const mask = options.mask.value
const size = Number(options.size.value)
const scale = Number(options.scale.value)
const gap = Math.min(Number(options.gap.value), scale) // not more than 1 module scaled size
// not more than (half of 1 scaled module size) - 1
// at gap=scale/2 squares disappear
const gap = Math.min(Number(options.gap.value), intDiv(scale, 2) - 1)
const wh = scale - gap * 2 // width&height for 1 module with grid gap