fix sprite editor code snippet

This commit is contained in:
Reimar 2025-10-11 19:17:25 +02:00
parent 264a918ff3
commit c2a8875af3
2 changed files with 9 additions and 4 deletions

View File

@ -62,8 +62,8 @@ export class SpriteEditor {
this.preview.snippet.innerHTML = "lib.drawSprite(<br>" + this.preview.snippet.innerHTML = "lib.drawSprite(<br>" +
" x, y,<br>" + " x, y,<br>" +
" width, height,<br>" + " width, height,<br>" +
` "${sanitizedName}"<br>` + ` <span class="str">"${sanitizedName}"</span><br>` +
");"; "<iden>)</iden>;";
} }
renderList() { renderList() {

View File

@ -282,13 +282,18 @@ footer {
} }
#sprite-editor-preview-snippet { #sprite-editor-preview-snippet {
background-color: black; background-color: #1d2021;
border: 1px solid black;
border-radius: 0.25rem; border-radius: 0.25rem;
padding: 0.125rem 0.25rem; padding: 0.125rem 0.25rem;
margin: 0.5rem; margin: 0.5rem;
white-space: pre; white-space: pre;
} }
#sprite-editor-preview-title:empty { #sprite-editor-preview-snippet .str {
color: #b8ba37;
}
#sprite-editor-preview-snippet:empty {
display: none; display: none;
} }