rename layer keyboard event fix

This commit is contained in:
Hugh Bord 2021-09-04 14:54:25 +10:00
parent 05b90149a0
commit 5498b22c98
3 changed files with 3 additions and 13 deletions

View File

@ -19,11 +19,6 @@ export default {
window.removeEventListener("keydown", this.keyListener.bind(this));
},
created() {
// window.stopKeyEvents = true
if (!window.stopKeyEvents) {
window.stopKeyEvents = false
}
this.keyListener = function (e) {
// Stop blocking input when modals are open
// Whatever this char "'\0'" is it'd occur even without pressing any keys

View File

@ -146,7 +146,7 @@ export default {
return "bg-gray-200";
},
showLayerRename(key, label) {
window.stopKeyEvents = true;
this.$store.commit("toggleDisableKeyboard", true);
this.$dialog
.prompt({
title: "Rename Layer",
@ -160,7 +160,7 @@ export default {
this.$toasted.show("You must enter a layer name!", {
type: "error",
});
window.stopKeyEvents = false;
this.$store.commit("toggleDisableKeyboard", false);
return;
}
@ -168,7 +168,7 @@ export default {
this.updateLayerName(key, result.input);
}
window.stopKeyEvents = false;
this.$store.commit("toggleDisableKeyboard", false);
});
},
updateLayerName(key, label) {

View File

@ -1260,11 +1260,6 @@ export default {
return;
}
// If the current pixel is not which needs to be replaced
// if (cyrb53(JSON.stringify(fillBlocks[y][x]) !== cyrb53(JSON.stringify(current)))) {
// return;
// }
// If the current pixel is not which needs to be replaced
if (this.canText && fillBlocks[y][x].char !== current.char) {
fillBlocks[y][x].bg = eraser ? null : this.currentBg;