Skip to content
Snippets Groups Projects
Commit 9e73c22c authored by Evan Raskob's avatar Evan Raskob
Browse files

simplifed a bit

parent 79c0fe06
Branches
No related merge requests found
......@@ -95,10 +95,6 @@
let result = document.getElementById("result");
let calcButton = document.getElementById("calculate");
const getChannels = () => parseInt(channels.selectedOptions[0].value);
const getChannel = () => parseInt(channel.selectedOptions[0].value);
channels.addEventListener('change', function () {
// let maxOffset = getChannels()-1;
doCalc();
......@@ -119,7 +115,10 @@
let x = parseInt(document.getElementById("x").value);
let y = parseInt(document.getElementById("y").value);
let calculation = (y * w + x) * getChannels() + getChannel();
// calculate index in pixels array:
let calculation = (y * w + x) *
parseInt(channels.selectedOptions[0].value) +
parseInt(channel.selectedOptions[0].value);
result.innerHTML = calculation;
}
</script>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment