bugfixing

This commit is contained in:
Blue 2018-11-20 14:49:16 +03:00
parent f26cdc128b
commit ccc39cac9a
4 changed files with 10 additions and 6 deletions

View File

@ -37,8 +37,8 @@ clear.addHandler(canvas.clear.bind(canvas));
window.addEventListener("resize", onWindowResize, false); window.addEventListener("resize", onWindowResize, false);
let form = new Form(panelWidth, panelHeight - panelPaddingTop); let form = new Form(panelWidth, panelHeight - panelPaddingTop);
let randomBox = new SwitchBox(random, 50, 30); let randomBox = new SwitchBox(random, 60, 30);
let amountBox = new NumericBox(50, 100); let amountBox = new NumericBox(100, 30);
amountBox.setValue(amountOfShapes); amountBox.setValue(amountOfShapes);
form.addLine("random", "Random amount of shapes",randomBox); form.addLine("random", "Random amount of shapes",randomBox);

View File

@ -92,6 +92,8 @@ button:hover {
} }
.form > div { .form > div {
overflow: hidden;
width: 100%;
-webkit-transition: height 0.2s ease-in-out; -webkit-transition: height 0.2s ease-in-out;
-moz-transition: height 0.2s ease-in-out; -moz-transition: height 0.2s ease-in-out;
-ms-transition: height 0.2s ease-in-out; -ms-transition: height 0.2s ease-in-out;
@ -100,6 +102,8 @@ button:hover {
} }
.form > div > div { .form > div > div {
overflow: hidden;
height: 100%;
float: left; float: left;
} }

View File

@ -41,7 +41,7 @@ class NumericBox extends UI {
this._input.addEventListener("input", this._boundInput); this._input.addEventListener("input", this._boundInput);
} }
_createInput() { _createInput() {
this._input = document.createElement("div"); this._input = document.createElement("input");
this._input.classList.add("numericBox"); this._input.classList.add("numericBox");
this.element.appendChild(this._input); this.element.appendChild(this._input);

View File

@ -60,13 +60,13 @@ class SwitchBox extends UI {
this.setValue(!this._value); this.setValue(!this._value);
} }
_setSize() { _setSize() {
let dh = this._width / 2.5; let dh = this._width / 2;
dh = Math.min(dh, this._height); dh = Math.min(dh, this._height);
let dw = dh * 2.5; let dw = dh * 2;
this._iWidth = dw; this._iWidth = dw;
this._iHeight = dh; this._iHeight = dh;
let circleDiameter = Math.round(dh * 0.80); let circleDiameter = Math.round(dh * 0.75);
this._input.style.width = dw + "px"; this._input.style.width = dw + "px";
this._input.style.height = dh + "px"; this._input.style.height = dh + "px";