|
@@ -51,15 +51,23 @@ class Webshot extends CallableInstance {
|
|
this.height = boundary;
|
|
this.height = boundary;
|
|
boundary = null;
|
|
boundary = null;
|
|
x = Math.floor(this.width / 2);
|
|
x = Math.floor(this.width / 2);
|
|
- let flag = 0;
|
|
|
|
|
|
+ let flag = false;
|
|
|
|
+ let cnt = 0;
|
|
for (let y = this.height - 1; y >= 0; y--) {
|
|
for (let y = this.height - 1; y >= 0; y--) {
|
|
const idx = (this.width * y + x) << 2;
|
|
const idx = (this.width * y + x) << 2;
|
|
if (this.data[idx] !== 255) {
|
|
if (this.data[idx] !== 255) {
|
|
- boundary = y;
|
|
|
|
if (!flag)
|
|
if (!flag)
|
|
- flag = 1;
|
|
|
|
- else
|
|
|
|
- break;
|
|
|
|
|
|
+ cnt++;
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (flag)
|
|
|
|
+ cnt++;
|
|
|
|
+ flag = false;
|
|
|
|
+ }
|
|
|
|
+ if (cnt === 3) {
|
|
|
|
+ boundary = y;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (boundary != null) {
|
|
if (boundary != null) {
|