Text gap and CSS fixes

pull/2/head
miguel 2020-11-18 22:15:57 +11:00
rodzic d25f4cc466
commit 628bb137a5
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -14,9 +14,9 @@ header {
canvas.inductorClass {
background: rgb(255, 255, 255);
margin: 0px;
padding: 5px;
border: 1px solid rgb(0, 0, 0);
margin: 1px;
padding: 2px;
border: 0px solid rgb(0, 0, 0);
display: block;
box-sizing: border-box;
}

Wyświetl plik

@ -566,10 +566,11 @@
fctx.textAlign = "center";
fctx.fillText("N = " + loop_turns_slider.value.toString(), win_width/2, win_height * 0.56);
// Draw spacing text:
// Draw spacing text: (gap is to avoid collision of spacing and length texts)
fctx.textAlign = "right";
var gap = ((loop_turns_slider.value*cond_spacing - cond_spacing) < 60) ? (60 - (loop_turns_slider.value*cond_spacing - cond_spacing)) : 0;
const spc = loop_spacing_slider.value * conductor_diameter_slider.value;
fctx.fillText("c = " + spc.toFixed(1).toString() + "mm", start_x + cond_spacing + 20, dim_y + 20);
fctx.fillText("c = " + spc.toFixed(1).toString() + "mm", start_x + cond_spacing + 20 - gap, dim_y + 20);
// Draw length text:
const sol_len = loop_turns_slider.value*spc;