Commit 630c08ad authored by Christian Winter's avatar Christian Winter

wip

parent f2915c77
......@@ -49,6 +49,7 @@ canvas {
position: absolute;
margin: 0;
padding: 0;
border:1px solid black;
}
canvas:hover {
......
......@@ -23,7 +23,7 @@
Logic.start();
//Renderer.setContext(this.currentView.context);
this.layoutGUI();
this.redrawAllViews();
}
......@@ -54,13 +54,29 @@
size.y = window.innerHeight - GUI.menubar.offsetHeight - GUI.statusbar.offsetHeight;
topLeft.x = leftarea.offsetWidth;
let width = size.x / this.views.length;
let height = size.y;
for (let i=0; i<this.views.length; ++i){
this.views[i].canvas.style.left = topLeft.x + width * i;
this.views[i].canvas.width = width;
this.views[i].canvas.height = height;
if (this.views.length < 4) {
let width = size.x / this.views.length;
let height = size.y;
for (let i = 0; i < this.views.length; ++i) {
this.views[i].canvas.style.left = topLeft.x + width * i;
this.views[i].canvas.width = width;
this.views[i].canvas.height = height;
}
}
else {
let length = Math.sqrt(this.views.length);
let width = size.x / length;
let height = size.y / length;
let i = 0;
for (let y = 0; y < length; ++y) {
for (let x = 0; x < length; ++x) {
this.views[i].canvas.style.left = topLeft.x + width * x;
this.views[i].canvas.style.top = topLeft.y + height * y;
this.views[i].canvas.width = width;
this.views[i].canvas.height = height;
++i;
}
}
}
/*
......@@ -87,7 +103,7 @@
}
redrawAllViews() {
for (let view of this.views)
for (let view of this.views)
view.renderer.redraw();
}
}
\ No newline at end of file
......@@ -38,6 +38,7 @@
// settings
this.finalRender = false;
this.isRenderPreviewing = false;
}
mouseMove(e) {
......@@ -519,7 +520,7 @@
case Key.Tab:
if (!Logic.isPreviewing()) {
Logic.isRenderPreviewing = true;
this.isRenderPreviewing = true;
this.renderer.setQualitySetting("quality");
this.renderer.redraw();
}
......@@ -553,7 +554,7 @@
case Key.Tab:
if (Logic.isPreviewing()) {
Logic.isRenderPreviewing = false;
this.isRenderPreviewing = false;
this.renderer.setQualitySetting(Preferences.qualitySetting);
this.renderer.redraw();
}
......
......@@ -21,15 +21,6 @@ class Input {
e.preventDefault();
}
break;
/*
case Key.Q:
let help = document.getElementById("help");
if (help.style.visibility == "hidden")
help.style.visibility = "visible";
else
help.style.visibility = "hidden";
break;
// */
case Key.F12:
if (!Preferences.developerMode == true) {
Exporter.renderPNG();
......@@ -87,7 +78,7 @@ class Input {
for (let keycode in Input.downKeys) {
if (Input.downKeys[keycode] == true) {
Logic.currentState.keyUp(+keycode);
CanvasKeyHandler.keyUp(+keycode);
Application.currentView.keyUp(+keycode);
}
}
Input.downKeys = [];
......
......@@ -57,7 +57,6 @@ class Logic {
this.currentState = new IdleState();
this.previousState = new IdleState();
this.isRenderPreviewing = false;
this.waitingState = null;
this.backlogState = null;
}
......@@ -170,7 +169,7 @@ class Logic {
}
static isPreviewing() {
return Logic.isRenderPreviewing;
return Application.currentView.isRenderPreviewing;
}
static toggleGridVisiblity(senderButton) {
......
......@@ -687,7 +687,7 @@
}
drawRenderHiddenLayer(layer) {
if (Logic.isRenderPreviewing && Preferences.renderGuideLayers == false)
if (Logic.isPreviewing() && Preferences.renderGuideLayers == false)
return;
this.view.context.setLineDash([Settings.guideDashSize * this.view.camera.zoom, Settings.guideDashSize * this.view.camera.zoom]);
......@@ -722,6 +722,9 @@
}
drawCursor() {
if (Application.currentView != this.view)
return;
if (Logic.currentState instanceof MeasureState) {
let size = cursorRange * Math.PI * 2 / 6 * this.view.camera.zoom;
this.view.context.setLineDash([size, size]);
......
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