format cleanup
This commit is contained in:
@@ -26,7 +26,7 @@ class BaseInputScriptElement extends BaseScriptElement {
|
||||
`;
|
||||
}
|
||||
|
||||
action() { console.log( this.value ); }
|
||||
action() { console.log("Input Value: ", this.value ); }
|
||||
}
|
||||
|
||||
class RepeatElement extends BaseInputScriptElement {
|
||||
@@ -60,26 +60,26 @@ class RepeatElement extends BaseInputScriptElement {
|
||||
}
|
||||
|
||||
class LeftElement extends BaseInputScriptElement {
|
||||
get prefix() { return 'Left'; }
|
||||
get defaultValue() { return '5'; }
|
||||
get prefix() { return 'Left'; }
|
||||
get defaultValue() { return '5'; }
|
||||
get postfix() { return 'degrees'; }
|
||||
constructor() { super(); }
|
||||
constructor() { super(); }
|
||||
action(Painter) { Painter.rotation -= this.value; }
|
||||
}
|
||||
|
||||
class RightElement extends BaseInputScriptElement {
|
||||
get prefix() { return 'Right'; }
|
||||
get defaultValue() { return '5'; }
|
||||
get prefix() { return 'Right'; }
|
||||
get defaultValue() { return '5'; }
|
||||
get postfix() { return 'degrees'; }
|
||||
constructor() { super(); }
|
||||
constructor() { super(); }
|
||||
action(Painter) { Painter.rotation += this.value; }
|
||||
}
|
||||
|
||||
class ForwardElement extends BaseInputScriptElement {
|
||||
get prefix() { return 'Forward'; }
|
||||
get defaultValue() { return '10'; }
|
||||
get postfix() { return 'steps'; }
|
||||
constructor() { super(); }
|
||||
get defaultValue() { return '10'; }
|
||||
get postfix() { return 'steps'; }
|
||||
constructor() { super(); }
|
||||
action(Painter) {
|
||||
let magnitude = this.value
|
||||
let radians = Painter.rotation * (Math.PI / 180);
|
||||
@@ -100,10 +100,10 @@ class ForwardElement extends BaseInputScriptElement {
|
||||
}
|
||||
|
||||
class BackElement extends BaseInputScriptElement {
|
||||
get prefix() { return 'Back'; }
|
||||
get defaultValue() { return '10'; }
|
||||
get prefix() { return 'Back'; }
|
||||
get defaultValue() { return '10'; }
|
||||
get postfix() { return 'steps'; }
|
||||
constructor() { super(); }
|
||||
constructor() { super(); }
|
||||
action(Painter) {
|
||||
let magnitude = this.value
|
||||
let radians = (Painter.rotation + 180) % 360;
|
||||
@@ -125,9 +125,9 @@ class BackElement extends BaseInputScriptElement {
|
||||
|
||||
class CircleElement extends BaseInputScriptElement {
|
||||
get prefix() { return 'Circle'; }
|
||||
get defaultValue() { return '20'; }
|
||||
get defaultValue() { return '20'; }
|
||||
get postfix() { return 'radius'; }
|
||||
constructor() { super(); }
|
||||
constructor() { super(); }
|
||||
action(Painter) {
|
||||
Painter.canvasContext.beginPath();
|
||||
Painter.canvasContext.arc(Painter.x1, Painter.y1, this.value, 0, 2 * Math.PI);
|
||||
@@ -159,9 +159,9 @@ class BackToCenterElement extends BaseScriptElement {
|
||||
|
||||
class BrushSizeElement extends BaseInputScriptElement {
|
||||
get prefix() { return 'Brush Size'; }
|
||||
get defaultValue() { return 24; }
|
||||
get postfix() { return 'px'; }
|
||||
constructor() { super(); }
|
||||
get defaultValue() { return 24; }
|
||||
get postfix() { return 'px'; }
|
||||
constructor() { super(); }
|
||||
connectedCallback() {
|
||||
this.innerHTML = `
|
||||
<li>
|
||||
@@ -172,15 +172,15 @@ class BrushSizeElement extends BaseInputScriptElement {
|
||||
`;
|
||||
}
|
||||
action(Painter) {
|
||||
Painter.brushSize = this.value;
|
||||
Painter.canvasContext.lineWidth = this.value;
|
||||
Painter.brushSize = this.value;
|
||||
Painter.canvasContext.lineWidth = this.value;
|
||||
}
|
||||
}
|
||||
|
||||
class BrushColorElement extends BaseInputScriptElement {
|
||||
get prefix() { return 'Brush Color'; }
|
||||
get defaultValue() { return '#000000'; }
|
||||
constructor() { super(); }
|
||||
get defaultValue() { return '#000000'; }
|
||||
constructor() { super(); }
|
||||
connectedCallback() {
|
||||
this.innerHTML = `
|
||||
<li>
|
||||
|
||||
Reference in New Issue
Block a user