mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-09-20 04:24:45 +00:00
Improved readability of sub-Paint.
This commit is contained in:
parent
dd2487d0d7
commit
eb31ea367a
1 changed files with 2 additions and 5 deletions
7
qb.js
7
qb.js
|
@ -906,7 +906,6 @@ var QB = new function() {
|
||||||
data[pixelIndex+1] = fillColor.g;
|
data[pixelIndex+1] = fillColor.g;
|
||||||
data[pixelIndex+2] = fillColor.b;
|
data[pixelIndex+2] = fillColor.b;
|
||||||
data[pixelIndex+3] = fillColor.a;
|
data[pixelIndex+3] = fillColor.a;
|
||||||
|
|
||||||
if (x > 0) {
|
if (x > 0) {
|
||||||
if (checkPixel(data, pixelIndex - 4, fillColor, borderColor)) {
|
if (checkPixel(data, pixelIndex - 4, fillColor, borderColor)) {
|
||||||
if (!flagLeft) {
|
if (!flagLeft) {
|
||||||
|
@ -917,7 +916,6 @@ var QB = new function() {
|
||||||
flagLeft = false;
|
flagLeft = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x < screen.canvas.width - 1) {
|
if (x < screen.canvas.width - 1) {
|
||||||
if (checkPixel(data, pixelIndex + 4, fillColor, borderColor)) {
|
if (checkPixel(data, pixelIndex + 4, fillColor, borderColor)) {
|
||||||
if (!flagRight) {
|
if (!flagRight) {
|
||||||
|
@ -928,7 +926,6 @@ var QB = new function() {
|
||||||
flagRight = false;
|
flagRight = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pixelIndex += screen.canvas.width * 4;
|
pixelIndex += screen.canvas.width * 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -939,8 +936,8 @@ var QB = new function() {
|
||||||
var g = dat[p+1];
|
var g = dat[p+1];
|
||||||
var b = dat[p+2];
|
var b = dat[p+2];
|
||||||
//var a = dat[p+3];
|
//var a = dat[p+3];
|
||||||
if ((r == c1.r) && (g == c1.g) && (b == c1.b)) { return false; }
|
if ((r == c1.r) && (g == c1.g) && (b == c1.b)) { return false; }
|
||||||
if ((r == c2.r) && (g == c2.g) && (b == c2.b)) { return false; }
|
if ((r == c2.r) && (g == c2.g) && (b == c2.b)) { return false; }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue