SP — 3 微调

This commit is contained in:
ciaochaos 2020-06-24 13:53:45 +08:00
parent 59f70c9bc1
commit 5b19ee5308
1 changed files with 8 additions and 5 deletions

View File

@ -58,6 +58,9 @@ function listPoints(qrcode, params) {
} }
if (ctn && qrcode.isDark(x + 1, y) && qrcode.isDark(x + 1, y + 2) && qrcode.isDark(x, y + 1) && qrcode.isDark(x + 2, y + 1)) { if (ctn && qrcode.isDark(x + 1, y) && qrcode.isDark(x + 1, y + 2) && qrcode.isDark(x, y + 1) && qrcode.isDark(x + 2, y + 1)) {
g1.push(<circle key={id++} cx={x + 1 + 0.5} cy={y + 1 + 0.5} r={1} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.33,0.6)} />) g1.push(<circle key={id++} cx={x + 1 + 0.5} cy={y + 1 + 0.5} r={1} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.33,0.6)} />)
if (qrcode.isDark(x + 1, y + 1)) {
g1.push(<circle r={0.5 * rand(0.5,1)} key={id++} fill={otherColor} cx={x + 1 + 0.5} cy={y + 1 + 0.5}/>)
}
available[x + 1][y] = false; available[x + 1][y] = false;
available[x][y + 1] = false; available[x][y + 1] = false;
available[x + 2][y + 1] = false; available[x + 2][y + 1] = false;
@ -82,24 +85,24 @@ function listPoints(qrcode, params) {
} }
if (available[x][y] && y < nCount - 1) { if (available[x][y] && y < nCount - 1) {
if (qrcode.isDark(x, y) && qrcode.isDark(x, y + 1)) { if (qrcode.isDark(x, y) && qrcode.isDark(x, y + 1)) {
pointList.push(<circle key={id++} cx={x + 0.5} cy={y + 1} r={0.5 * rand(0.9,1.1)} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.4,0.5)} />) pointList.push(<circle key={id++} cx={x + 0.5} cy={y + 1} r={0.5 * rand(0.95,1.05)} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.36,0.4)} />)
available[x][y] = false; available[x][y] = false;
available[x][y + 1] = false; available[x][y + 1] = false;
} }
} }
if (available[x][y] && x < nCount - 1) { if (available[x][y] && x < nCount - 1) {
if (qrcode.isDark(x, y) && qrcode.isDark(x + 1, y)) { if (qrcode.isDark(x, y) && qrcode.isDark(x + 1, y)) {
pointList.push(<circle key={id++} cx={x + 1} cy={y + 0.5} r={0.5 * rand(0.9,1.1)} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.36,0.5)} />) pointList.push(<circle key={id++} cx={x + 1} cy={y + 0.5} r={0.5 * rand(0.95,1.05)} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.36,0.4)} />)
available[x][y] = false; available[x][y] = false;
available[x + 1][y] = false; available[x + 1][y] = false;
} }
} }
if (available[x][y]) { if (available[x][y]) {
if (qrcode.isDark(x, y)) { if (qrcode.isDark(x, y)) {
pointList.push(<circle r={0.5 * rand(0.33,0.9)} key={id++} fill={otherColor} cx={x + 0.5} cy={y + 0.5}/>) pointList.push(<circle r={0.5 * rand(0.5,1)} key={id++} fill={otherColor} cx={x + 0.5} cy={y + 0.5}/>)
} else if (typeTable[x][y] === QRPointType.DATA) { } else if (typeTable[x][y] === QRPointType.DATA) {
if (rand(0,1) > 0.8) { if (rand(0,1) > 0.85) {
g2.push(<circle r={0.5 * rand(0.7,1.3)} key={id++} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.15,0.33)} cx={x + 0.5} cy={y + 0.5}/>) g2.push(<circle r={0.5 * rand(0.85,1.3)} key={id++} fill="#FFFFFF" stroke={otherColor} strokeWidth={rand(0.15,0.33)} cx={x + 0.5} cy={y + 0.5}/>)
} }
} }
} }