this
JS-0105 927 this.linesIndex = 0;
928 }
929
930 chunk(arr, chunkSize) { 931 var R = [];
932 for (var i = 0, len = arr.length; i < len; i += chunkSize) R.push(arr.slice(i, i + chunkSize));
933 return R;
728 return data
729 }
730
731 displayViewBox(show) { 732 showViewBox(show)
733 }
734
643 this.simulationStopped();
644 }
645
646 clamp(value, min, max) { 647 return Math.min(Math.max(value, min), max);
648 }
649
609 return this.gcodeProcessor.currentLineNumber;
610 }
611
612 goToGCodeLine(lineNumber) {} 613
614 simulateToolPosition() {
615 this.updateToolPosition(this.gcodeProcessor.nozzlePosition);
397 this.gcodeProcessor.setProgressColor(value);
398 }
399
400 getBackgroundColor() { 401 let color = localStorage.getItem('sceneBackgroundColor');
402 if (color === null) {
403 color = '#000000';
If a class method does not use this
, it can sometimes be made into a static function. If you do convert the method into a static function, instances of the class that call that particular method have to be converted to a static call as well (MyClass.callStaticMethod())
class Person {
sayHi() {
const greeting = document.createElement("div");
greeting.innerText = "Hello!";
document.appendChild();
}
}
const person = new Person();
person.sayHi();
class Person {
static sayHi() {
const greeting = document.createElement("div");
greeting.innerText = "Hello!";
document.appendChild();
}
}
Person.sayHi();