Fix bug where coloring in same pixel and dragging over it with color prevents undo from working properly

This commit is contained in:
Joshua Sigona 2020-06-14 20:57:04 +09:00
parent cc8e2bbffb
commit c2dd7a2b12

View File

@ -130,6 +130,7 @@ document.addEventListener("DOMContentLoaded",()=>{
if (e.target.tagName==="TH") {
if (mouseState>=0) {
var mycoords = getCoordinates(e.target)
if (!(e.target.id in changedPixels)) {
if ("PIXELS" in changedPixels) {
changedPixels["PIXELS"]+=","+mycoords.x+","+mycoords.y
} else {
@ -148,6 +149,7 @@ document.addEventListener("DOMContentLoaded",()=>{
}
}
}
}
var MouseClickListener = (e)=>{
e.preventDefault();
}
@ -198,6 +200,7 @@ document.addEventListener("DOMContentLoaded",()=>{
if (!fillTool) {
if (e.target.tagName==="TH") {
var mycoords = getCoordinates(e.target)
if (!(e.target.id in changedPixels)) {
if ("PIXELS" in changedPixels) {
changedPixels["PIXELS"]+=","+mycoords.x+","+mycoords.y
} else {
@ -214,6 +217,7 @@ document.addEventListener("DOMContentLoaded",()=>{
changedPixels["STEPTYPE"]="ADD"
}
}
}
toolbar.style.visibility = "hidden";
}