fix: pixel id to index
This commit is contained in:
parent
804d609dd5
commit
cd4ed8a6d2
|
@ -82,7 +82,7 @@ function hexToRgb(hex) {
|
|||
// Initialize pixel index
|
||||
function initUserPixel() {
|
||||
var user_pixel_index = 0;
|
||||
var pixel_index = userJSON.pixels[user_pixel_index].id - 1;
|
||||
var pixel_index = userJSON.pixels[user_pixel_index] - 1;
|
||||
|
||||
document.getElementById("user-pixel-index").innerHTML = user_pixel_index;
|
||||
document.getElementById("pixel-index").innerHTML = pixel_index;
|
||||
|
@ -99,7 +99,7 @@ function nextUserPixel() {
|
|||
user_pixel_index = 0;
|
||||
}
|
||||
|
||||
var pixel_index = userJSON.pixels[user_pixel_index].id - 1;
|
||||
var pixel_index = userJSON.pixels[user_pixel_index] - 1;
|
||||
|
||||
document.getElementById("user-pixel-index").innerHTML = user_pixel_index;
|
||||
document.getElementById("pixel-index").innerHTML = pixel_index;
|
||||
|
@ -116,7 +116,7 @@ function previousUserPixel() {
|
|||
user_pixel_index = userJSON.pixels.length - 1;
|
||||
}
|
||||
|
||||
var pixel_index = userJSON.pixels[user_pixel_index].id - 1;
|
||||
var pixel_index = userJSON.pixels[user_pixel_index] - 1;
|
||||
|
||||
document.getElementById("user-pixel-index").innerHTML = user_pixel_index;
|
||||
document.getElementById("pixel-index").innerHTML = pixel_index;
|
||||
|
|
Loading…
Reference in a new issue