Fix bug when last line is not empty
This commit is contained in:
parent
5fe58b2eca
commit
ad14be7b75
|
@ -5,7 +5,7 @@ animate();
|
|||
|
||||
function init() {
|
||||
|
||||
let url = (document.URL.split('?')[1] || "exemple/suzanne.obja");
|
||||
let url = (document.URL.split('?')[1] || "example/suzanne.obja");
|
||||
|
||||
loader = new Loader(url, 1024, 20);
|
||||
loader.start(function(elements) {
|
||||
|
|
|
@ -196,6 +196,9 @@ class Loader {
|
|||
let upperBound = Math.min(this.currentByte + this.chunkSize, this.dataLength);
|
||||
|
||||
if (upperBound <= this.currentByte) {
|
||||
if (this.remainder !== "") {
|
||||
callback([parseLine(this.remainder, 0)]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -196,6 +196,9 @@ class Loader {
|
|||
let upperBound = Math.min(this.currentByte + this.chunkSize, this.dataLength);
|
||||
|
||||
if (upperBound <= this.currentByte) {
|
||||
if (this.remainder !== "") {
|
||||
callback([parseLine(this.remainder, 0)]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue