Browse Source

Make the scale sliders bigger and fix them getting stuck

tags/v0.1.0
Fen Dweller 5 years ago
parent
commit
4a0948d905
2 changed files with 13 additions and 2 deletions
  1. +3
    -2
      macrovision.css
  2. +10
    -0
      macrovision.js

+ 3
- 2
macrovision.css View File

@@ -437,6 +437,7 @@ a {
z-index: 1000;
width: 250px;
height: 50px;
transform: scale(1.5);
}

body.toggle-scale-sliders .floating-slider {
@@ -444,7 +445,7 @@ body.toggle-scale-sliders .floating-slider {
}

#slider-scale {
top: 1%;
top: 5%;
left: 5%;
}

@@ -457,7 +458,7 @@ body.toggle-scale-sliders .floating-slider {
}

#slider-entity-scale {
top: 1%;
top: 5%;
right: 5%;
}



+ 10
- 0
macrovision.js View File

@@ -962,10 +962,16 @@ window.onfocus = function () {
}

function doSliderScale() {
if (sliderScale == 1) {
clearInterval(dragScaleHandle);
}
setWorldHeight(config.height, math.multiply(config.height, (9 + sliderScale) / 10));
}

function doSliderEntityScale() {
if (sliderEntityScale == 1) {
clearInterval(dragEntityScaleHandle);
}
if (selected) {
const entity = entities[selected.dataset.key];
entity.scale *= (9 + sliderEntityScale) / 10;
@@ -1047,11 +1053,13 @@ document.addEventListener("DOMContentLoaded", () => {
});

document.querySelector("#slider-scale").addEventListener("mousedown", e => {
clearInterval(dragScaleHandle);
dragScaleHandle = setInterval(doSliderScale, 50);
e.stopPropagation();
});

document.querySelector("#slider-scale").addEventListener("touchstart", e => {
clearInterval(dragScaleHandle);
dragScaleHandle = setInterval(doSliderScale, 50);
e.stopPropagation();
});
@@ -1072,11 +1080,13 @@ document.addEventListener("DOMContentLoaded", () => {
});

document.querySelector("#slider-entity-scale").addEventListener("mousedown", e => {
clearInterval(dragEntityScaleHandle);
dragEntityScaleHandle = setInterval(doSliderEntityScale, 50);
e.stopPropagation();
});

document.querySelector("#slider-entity-scale").addEventListener("touchstart", e => {
clearInterval(dragEntityScaleHandle);
dragEntityScaleHandle = setInterval(doSliderEntityScale, 50);
e.stopPropagation();
});


Loading…
Cancel
Save