Fixknob flex-wrap glitching issues
This commit is contained in:
parent
84048f8867
commit
cb83a95351
1 changed files with 7 additions and 5 deletions
|
|
@ -35,6 +35,7 @@ colorPicker.addEventListener("input", changeColor);
|
|||
colorPicker.addEventListener("change", changeColor);
|
||||
backColorPicker.addEventListener("input", pickBackground);
|
||||
reset.addEventListener("click", resetGrid);
|
||||
|
||||
gridSlider.addEventListener("input", getGridDimensions);
|
||||
gridSlider.addEventListener("change", getGridDimensions);
|
||||
rangeKnob.addEventListener("mousedown", (e) => {
|
||||
|
|
@ -63,13 +64,14 @@ function rotateKnob(e) {
|
|||
x: knobBounds.left + knobBounds.width / 2,
|
||||
y: knobBounds.top + knobBounds.height / 2
|
||||
};
|
||||
let angle = Math.atan2(e.pageX - knobCenter.x, - (e.pageY - knobCenter.y) )*(180 / Math.PI);
|
||||
let angle = Math.atan2(e.clientX - knobCenter.x, -(e.clientY - knobCenter.y)) * (180 / Math.PI);
|
||||
|
||||
rangeKnob.style.transform = `rotate(${angle}deg)`;
|
||||
|
||||
updateGridSlider(angle);
|
||||
}
|
||||
|
||||
|
||||
function updateGridSlider(angle) {
|
||||
const maxRotation = 360;
|
||||
const minSliderVal = gridSlider.min;
|
||||
|
|
|
|||
Loading…
Reference in a new issue