From ccc39cac9a3cc22a63634ab8ce1669fbcbee3738 Mon Sep 17 00:00:00 2001 From: blue Date: Tue, 20 Nov 2018 14:49:16 +0300 Subject: [PATCH] bugfixing --- main.js | 4 ++-- style.css | 4 ++++ ui/editors/numericBox.js | 2 +- ui/editors/switchBox.js | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index 24d63c4..9842d46 100644 --- a/main.js +++ b/main.js @@ -37,8 +37,8 @@ clear.addHandler(canvas.clear.bind(canvas)); window.addEventListener("resize", onWindowResize, false); let form = new Form(panelWidth, panelHeight - panelPaddingTop); -let randomBox = new SwitchBox(random, 50, 30); -let amountBox = new NumericBox(50, 100); +let randomBox = new SwitchBox(random, 60, 30); +let amountBox = new NumericBox(100, 30); amountBox.setValue(amountOfShapes); form.addLine("random", "Random amount of shapes",randomBox); diff --git a/style.css b/style.css index 13f3502..e113f84 100644 --- a/style.css +++ b/style.css @@ -92,6 +92,8 @@ button:hover { } .form > div { + overflow: hidden; + width: 100%; -webkit-transition: height 0.2s ease-in-out; -moz-transition: height 0.2s ease-in-out; -ms-transition: height 0.2s ease-in-out; @@ -100,6 +102,8 @@ button:hover { } .form > div > div { + overflow: hidden; + height: 100%; float: left; } diff --git a/ui/editors/numericBox.js b/ui/editors/numericBox.js index d05c06b..663f4d6 100644 --- a/ui/editors/numericBox.js +++ b/ui/editors/numericBox.js @@ -41,7 +41,7 @@ class NumericBox extends UI { this._input.addEventListener("input", this._boundInput); } _createInput() { - this._input = document.createElement("div"); + this._input = document.createElement("input"); this._input.classList.add("numericBox"); this.element.appendChild(this._input); diff --git a/ui/editors/switchBox.js b/ui/editors/switchBox.js index 767ca3c..ddea4a9 100644 --- a/ui/editors/switchBox.js +++ b/ui/editors/switchBox.js @@ -60,13 +60,13 @@ class SwitchBox extends UI { this.setValue(!this._value); } _setSize() { - let dh = this._width / 2.5; + let dh = this._width / 2; dh = Math.min(dh, this._height); - let dw = dh * 2.5; + let dw = dh * 2; this._iWidth = dw; 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.height = dh + "px";