Commit cd4314d5 authored by Christian Winter's avatar Christian Winter

mirrorX and mirrorY now part of globals

parent c2905fe3
Pipeline #5143825 passed with stage
in 53 seconds
......@@ -824,11 +824,11 @@
// Mirror buttons
static mirrorXTogglePressed() {
mirrorX = !mirrorX;
Globals.mirrorX = !Globals.mirrorX;
this.updateMirrorXToggle()
}
static updateMirrorXToggle() {
if (mirrorX)
if (Globals.mirrorX)
this.mirrorXToggle.setAttribute("class", "pressed");
else
this.mirrorXToggle.removeAttribute("class");
......@@ -836,11 +836,11 @@
}
static mirrorYTogglePressed() {
mirrorY = !mirrorY;
Globals.mirrorY = !Globals.mirrorY;
this.updateMirrorYToggle()
}
static updateMirrorYToggle() {
if (mirrorY)
if (Globals.mirrorY)
this.mirrorYToggle.setAttribute("class", "pressed");
else
this.mirrorYToggle.removeAttribute("class");
......
......@@ -5,9 +5,6 @@ let toolbar;
let waitingForStart = [];
let mirrorX = false;
let mirrorY = false;
class Logic {
constructor() {
this.currentState = new IdleState();
......
......@@ -210,7 +210,7 @@
}
// current Layer
if (mirrorX || mirrorY)
if (Globals.mirrorX || Globals.mirrorY)
this.drawMirroredLines();
// draw green outline if in prefab edit mode
......@@ -299,11 +299,11 @@
if (!this.view.isRenderPreviewing)
color.a = 0.3;
if (mirrorX)
if (Globals.mirrorX)
this.drawLineFromTo(line.start.position.mirrorX(), line.end.position.mirrorX(), thickness, color);
if (mirrorY)
if (Globals.mirrorY)
this.drawLineFromTo(line.start.position.mirrorY(), line.end.position.mirrorY(), thickness, color);
if (mirrorX && mirrorY)
if (Globals.mirrorX && Globals.mirrorY)
this.drawLineFromTo(line.start.position.flipped(), line.end.position.flipped(), thickness, color);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment