Skip to content

Commit 567eab1

Browse files
committed
attribute name changed
1 parent 9ae53d1 commit 567eab1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

js/engine.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Engine {
2323
this._actualFrameRate = 0;
2424
this._noLoop = false;
2525
this._then = null;
26-
this._recording = false;
26+
this._is_recording = false;
2727
this._first_frame_recorded = 0;
2828
this._zip = null;
2929

@@ -78,7 +78,7 @@ class Engine {
7878
this.draw();
7979
this._ctx.restore();
8080
// save current frame if recording
81-
if (this._recording) {
81+
if (this._is_recording) {
8282
// compute frame name
8383
const frame_count = this._frameCount - this._first_frame_recorded;
8484
const filename = frame_count.toString().padStart(7, 0) + ".png";
@@ -114,7 +114,7 @@ class Engine {
114114
* Start recording frames
115115
*/
116116
startRecording() {
117-
this._recording = true;
117+
this._is_recording = true;
118118
this._first_frame_recorded = this._frameCount;
119119
this._zip = new JSZip();
120120
}
@@ -123,7 +123,7 @@ class Engine {
123123
* Stop recording frames
124124
*/
125125
stopRecording() {
126-
this._recording = false;
126+
this._is_recording = false;
127127
}
128128

129129
/**
@@ -134,7 +134,7 @@ class Engine {
134134
saveRecording(filename = "frames.zip") {
135135
// if the recording is not active, do nothing
136136
// also skipped if no frame has been recorded
137-
if (this._recording || !this._zip) return;
137+
if (this._is_recording || !this._zip) return;
138138

139139
// download zip file
140140
this._zip.generateAsync({ type: "blob" }).then((blob) => {
@@ -366,7 +366,7 @@ class Engine {
366366
* @returns {Boolean} The current recording state
367367
*/
368368
get recording() {
369-
return this._recording;
369+
return this._is_recording;
370370
}
371371

372372
/**
@@ -414,6 +414,13 @@ class Engine {
414414
get height() {
415415
return this._canvas.height;
416416
}
417+
418+
/**
419+
* Get the current recording state
420+
*/
421+
get is_recording() {
422+
return this._is_recording;
423+
}
417424
}
418425

419426
document.addEventListener("DOMContentLoaded", () => {

0 commit comments

Comments
 (0)