add line spacing control

This commit is contained in:
Koen Lageveen 2017-01-05 22:21:34 +01:00
parent 43aef578d9
commit b123cd8a93
1 changed files with 11 additions and 3 deletions

View File

@ -135,8 +135,9 @@
width: 9em;
margin-left: .5ex;
}
#size {
width: 3em;
#size,
#spacing {
width: 4em;
margin-left: .5ex;
}
pre,
@ -225,7 +226,11 @@
</p>
<p>
<label for="size">Size</label>
<input onchange="setSize()" type="number" id="size" value="14">
<input onchange="setSize()" type="number" id="size" value="14" min="1" max="32" step="1">
</p>
<p>
<label for="spacing">Spacing</label>
<input onchange="setSpacing()" type="number" id="spacing" value="1.2" min="1" max="2" step="0.1">
</p>
<p>
<label for="aliasing">Anti-aliasing </label><input onchange="setAntialiasing()" type="checkbox" id="aliasing" checked>
@ -334,6 +339,9 @@ function updateGutters(cm) {
function setSize() {
$(".CodeMirror").css({ fontSize: $("#size").val() + "px" });
}
function setSpacing() {
$(".CodeMirror").css({ lineHeight: $("#spacing").val() });
}
function setAntialiasing() {
if ($("#aliasing").is(":checked")) {
$(".CodeMirror").removeClass("no-smooth");