Commit c4971e15 authored by Christian Winter's avatar Christian Winter

place polar grid at pivot now part of polargrid class

parent 1bccd071
Pipeline #5143773 passed with stage
in 54 seconds
......@@ -131,7 +131,7 @@
pivot = Application.cursor.currentPosition;
if (Preferences.gridType == 2)
if (placePolarGridCenterAt2DCursor == true)
if (GridManager.grid.placePolarGridCenterAt2DCursor == true)
GridManager.grid.positionOffset = pivot.copy();
}
......
......@@ -5,6 +5,7 @@ class PolarGrid {
this.radius = 50;
this.segments = 36;
this.angleOffset = 90;
this.placePolarGridCenterAt2DCursor = false;
this.positionOffset = Vector2.zero;
this.thickness = 0.33;
......
......@@ -316,7 +316,7 @@
table.appendChild(tr);
td = document.createElement("td");
td.innerHTML = "Use 2D-Cursor as center";
td.innerHTML = "Use Pivot as center";
tr.appendChild(td);
td = document.createElement("td");
......@@ -325,14 +325,14 @@
input = document.createElement("input");
input.setAttribute("type", "checkbox");
//input.setAttribute("min", "1");
if (placePolarGridCenterAt2DCursor == true)
if (GridManager.grid.placePolarGridCenterAt2DCursor == true)
input.setAttribute("checked", true);
input.setAttribute("onchange", "GUI.setPolarGridCenterToPivot(checked)");
td.appendChild(input);
if (placePolarGridCenterAt2DCursor == false) {
if (GridManager.grid.placePolarGridCenterAt2DCursor == false) {
// posOffsetX
tr = document.createElement("tr");
table.appendChild(tr);
......@@ -716,9 +716,9 @@
}
static setPolarGridCenterToPivot(checked) {
placePolarGridCenterAt2DCursor = checked;
GridManager.grid.placePolarGridCenterAt2DCursor = checked;
if (placePolarGridCenterAt2DCursor == true)
if (GridManager.grid.placePolarGridCenterAt2DCursor == true)
GridManager.grid.positionOffset = pivot.copy();
else
GridManager.grid.positionOffset = Vector2.zero;
......
......@@ -12,8 +12,6 @@ let waitingForStart = [];
let mirrorX = false;
let mirrorY = false;
let placePolarGridCenterAt2DCursor = false;
class Logic {
constructor() {
this.currentState = new IdleState();
......
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