Skip to content

Commit 7762f3b

Browse files
update
1 parent c8dedcf commit 7762f3b

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/volumetricdisplay/index.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@
14751475
resetFireButton: null
14761476
},
14771477
init() {
1478-
const buildFirePixels = () => {
1478+
const buildFireVoxels = () => {
14791479
this.instanceData.fireVoxelsXyz = [];
14801480
for (let x = 0, xc = (VolumetricDisplay.layersX.length - 1); x < xc; x++) {
14811481
const xAr = [];
@@ -1522,13 +1522,11 @@
15221522
this.instanceData.resetFireButton.addEventListener('click', (event) => {
15231523
event.stopPropagation();
15241524
event.preventDefault();
1525-
VolumetricDisplay.fill();
1526-
VolumetricDisplay.update();
1527-
buildFirePixels();
1525+
buildFireVoxels();
15281526
this.instanceData.requestAnimate = true;
15291527
});
15301528
if (this.instanceData.fireVoxelsXyz.length === 0) {
1531-
buildFirePixels();
1529+
buildFireVoxels();
15321530
} else {
15331531
this.instanceData.requestAnimate = true;
15341532
}
@@ -1539,9 +1537,9 @@
15391537
if (this.instanceData.isPaused && !this.instanceData.requestAnimate) {
15401538
return;
15411539
}
1542-
const currentTimeMs = Date.now();
1543-
if (((currentTimeMs - this.instanceData.lastTimeMs) > 30) || this.instanceData.requestAnimate) {
1544-
this.instanceData.lastTimeMs = currentTimeMs;
1540+
const timeMs = Date.now();
1541+
if (((timeMs - this.instanceData.lastTimeMs) > 30) || this.instanceData.requestAnimate) {
1542+
this.instanceData.lastTimeMs = timeMs;
15451543
if (!this.instanceData.isPaused) {
15461544
for (let y = 0, yc = (VolumetricDisplay.layersY.length - 2); y < yc; y++) {
15471545
for (let x = 0, xc = (VolumetricDisplay.layersX.length - 1); x < xc; x++) {

0 commit comments

Comments
 (0)