text tool bug fixes, readme update
This commit is contained in:
parent
9d9fb6c6f0
commit
5e0d3ae2ea
|
@ -77,6 +77,7 @@ ASCIIBIRD is mostly usable. There are some bugs however to note at the moment. R
|
|||
|
||||
* Warning on mirc export if ascii exceeds IRCs 512 per chat line limit.
|
||||
* Review encodings check on file import - UTF8 vs Latin something
|
||||
|
||||
# Keyboard Shortcuts
|
||||
|
||||
## ASCII Editing
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
<br>
|
||||
|
||||
<span class="ml-5">ASCII Internal Size: {{ asciiStats.sizeUncompressed }} </span> <br>
|
||||
<span class="ml-5">State Internal Size: {{ asciiStats.stateSize }} </span> <br>
|
||||
|
||||
<div class="mb-4 border-t-2">
|
||||
<div class="mt-1 p-2 bg-red-300 rounded-md cursor-pointer" @click="copyUriToClipboard()">Copy URI Encoded String</div>
|
||||
|
@ -109,11 +109,11 @@ export default {
|
|||
},
|
||||
asciiStats() {
|
||||
// const compressed = ( JSON.stringify(this.currentAscii) / 1024).toFixed(2);
|
||||
const uncompressed = (JSON.stringify(this.currentAscii).length / 1024).toFixed(2);
|
||||
|
||||
// const stateSize = (JSON.stringify(this.state).length / 1024).toFixed(2);
|
||||
// const uncompressed = (JSON.stringify(this.currentAscii).length / 1024).toFixed(2);
|
||||
const stateSize = (JSON.stringify(this.state).length / 1024).toFixed(2);
|
||||
return {
|
||||
sizeUncompressed: `${uncompressed}kb`,
|
||||
stateSize: `${stateSize}kb`,
|
||||
|
||||
};
|
||||
},
|
||||
currentTool() {
|
||||
|
@ -204,6 +204,9 @@ export default {
|
|||
|
||||
this.$store.commit('changeDebugPanelState', this.panel);
|
||||
},
|
||||
exportMirc() {
|
||||
return exportMirc()
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -207,15 +207,11 @@ export default new Vuex.Store({
|
|||
state.toolbarState.mirrorX = payload.x;
|
||||
state.toolbarState.mirrorY = payload.y;
|
||||
},
|
||||
updateAsciiBlocks(state, payload, skipUndo = false) {
|
||||
updateAsciiBlocks(state, payload) {
|
||||
if (state.asciibirdMeta[state.tab].history.length >= state.options.undoLimit) {
|
||||
state.asciibirdMeta[state.tab].history.shift()
|
||||
}
|
||||
|
||||
// if (!skipUndo) {
|
||||
// state.asciibirdMeta[state.tab].history.push(state.asciibirdMeta[state.tab].layers);
|
||||
// }
|
||||
|
||||
let tempLayers = JSON.parse(LZString.decompressFromUTF16(state.asciibirdMeta[state.tab].layers))
|
||||
|
||||
tempLayers[state.asciibirdMeta[state.tab].selectedLayer].data = payload.blocks
|
||||
|
|
|
@ -83,9 +83,8 @@ export default {
|
|||
event.preventDefault();
|
||||
|
||||
if (_this.isTextEditing) {
|
||||
console.log("text edit");
|
||||
_this.canvasKeyDown(event.key);
|
||||
// return;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_this.isBrushing || _this.isErasing) {
|
||||
|
@ -425,7 +424,7 @@ export default {
|
|||
methods: {
|
||||
canvasKeyDown(char) {
|
||||
// if (this.isTextEditing) {
|
||||
console.log(char);
|
||||
console.log(char);
|
||||
if (
|
||||
this.currentAsciiLayerBlocks[this.textEditing.startY] &&
|
||||
this.currentAsciiLayerBlocks[this.textEditing.startY][
|
||||
|
@ -453,14 +452,12 @@ export default {
|
|||
];
|
||||
|
||||
oldBlock = {
|
||||
...this.currentAsciiLayerBlocks[this.textEditing.startY][
|
||||
this.textEditing.startX - 1
|
||||
],
|
||||
... targetBlock
|
||||
};
|
||||
|
||||
this.currentAsciiLayerBlocks[this.textEditing.startY][
|
||||
delete this.currentAsciiLayerBlocks[this.textEditing.startY][
|
||||
this.textEditing.startX - 1
|
||||
].char = null;
|
||||
]['char'];
|
||||
|
||||
this.storeDiffBlocks(
|
||||
this.textEditing.startX,
|
||||
|
@ -489,9 +486,9 @@ export default {
|
|||
|
||||
oldBlock = { ...targetBlock };
|
||||
|
||||
this.currentAsciiLayerBlocks[this.textEditing.startY][
|
||||
delete this.currentAsciiLayerBlocks[this.textEditing.startY][
|
||||
this.textEditing.startX
|
||||
].char = null;
|
||||
]['char'];
|
||||
|
||||
this.storeDiffBlocks(
|
||||
this.textEditing.startX,
|
||||
|
@ -508,7 +505,7 @@ export default {
|
|||
this.currentAsciiWidth - this.textEditing.startX
|
||||
];
|
||||
oldBlock = { ...targetBlock };
|
||||
targetBlock.char = null;
|
||||
delete targetBlock['char'];
|
||||
this.storeDiffBlocks(
|
||||
this.textEditing.startX,
|
||||
this.textEditing.startY,
|
||||
|
@ -518,11 +515,19 @@ export default {
|
|||
}
|
||||
|
||||
if (this.mirrorY) {
|
||||
|
||||
targetBlock =
|
||||
this.currentAsciiLayerBlocks[
|
||||
this.currentAsciiHeight - this.textEditing.startY
|
||||
][this.textEditing.startX];
|
||||
targetBlock.char = null;
|
||||
oldBlock = { ...targetBlock };
|
||||
delete targetBlock['char'];
|
||||
this.storeDiffBlocks(
|
||||
this.textEditing.startX,
|
||||
this.textEditing.startY,
|
||||
oldBlock,
|
||||
targetBlock);
|
||||
|
||||
}
|
||||
|
||||
if (this.mirrorY && this.mirrorX) {
|
||||
|
@ -531,7 +536,7 @@ export default {
|
|||
this.currentAsciiHeight - this.textEditing.startY
|
||||
][this.currentAsciiWidth - this.textEditing.startX];
|
||||
oldBlock = { ...targetBlock };
|
||||
targetBlock.char = null;
|
||||
delete targetBlock['char'];
|
||||
this.storeDiffBlocks(
|
||||
this.textEditing.startX,
|
||||
this.textEditing.startY,
|
||||
|
@ -683,15 +688,11 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
// Emit back to dashboard then to editor that we need to redraw the canvas
|
||||
// this.$emit("updatecanvas");
|
||||
|
||||
this.clearToolCanvas();
|
||||
this.drawTextIndicator();
|
||||
this.drawIndicator();
|
||||
|
||||
this.delayRedrawCanvas();
|
||||
// }
|
||||
},
|
||||
warnInvisibleLayer() {
|
||||
if (!this.currentSelectedLayer && this.currentSelectedLayer.visible) {
|
||||
|
@ -1761,9 +1762,6 @@ export default {
|
|||
// Fill next col
|
||||
this.fillTool(fillBlocks, y + 1, x, current, eraser);
|
||||
},
|
||||
// async updateFillBlocksAsync(x, y, oldBlock, newBlock) {
|
||||
// return await this.storeDiffBlocks(x, y, oldBlock, newBlock)
|
||||
// }
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue