fix for brush from select in art.txt

This commit is contained in:
Hugh Bord 2022-01-06 15:53:55 +10:00
parent 359c3d41ba
commit 0078653253
2 changed files with 29 additions and 1 deletions

View File

@ -224,7 +224,7 @@ export const parseMircAscii = async (contents, filename) => {
.split('\u0003\n').join('\n')
.split('\u0002\u0003').join('\u0003')
.split('\u0002').join('') // bold
.split('\u001D').join(''); // italics
.split('\u001D').join(''); // bg highlight
let asciiLines = contents.split("\n");
@ -265,6 +265,9 @@ export const parseMircAscii = async (contents, filename) => {
if (cleanedWidth > finalAscii.layers[0].width) {
finalAscii.layers[0].width = cleanedWidth;
}
// Save some time on large asciis?
// if (i > 50) break;
}
// https://modern.ircdocs.horse/formatting.html#color
@ -367,6 +370,18 @@ export const parseMircAscii = async (contents, filename) => {
curBlock.char = char;
if (curBlock.bg === null) {
delete curBlock['bg']
}
if (curBlock.fg === null) {
delete curBlock['fg']
}
if (curBlock.char === null) {
delete curBlock['char']
}
finalAscii.layers[0].data[y][i] = {
...curBlock
};

View File

@ -1325,6 +1325,19 @@ export default {
this.currentAsciiLayerBlocks[y] &&
this.currentAsciiLayerBlocks[y][x]
) {
if (this.currentAsciiLayerBlocks[y][x].bg === null) {
delete this.currentAsciiLayerBlocks[y][x]['bg']
}
if (this.currentAsciiLayerBlocks[y][x].fg === null) {
delete this.currentAsciiLayerBlocks[y][x]['fg']
}
if (this.currentAsciiLayerBlocks[y][x].char === null) {
delete this.currentAsciiLayerBlocks[y][x]['char']
}
curBlock = { ...this.currentAsciiLayerBlocks[y][x] };
if (!this.selectedBlocks[y][x]) {