Fix bug when last line is not empty

master
Thomas Forgione 12 months ago
parent 5fe58b2eca
commit ad14be7b75
  1. 2
      js/main.js
  2. 3
      js/obja.js
  3. 3
      src/Loader.js

@ -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…
Cancel
Save