Fix #2118 Undo in new image project deletes the image

Tab bar CSS improvements
This commit is contained in:
JannisX11 2023-11-30 18:12:31 +01:00
parent de9b199a97
commit be39e6af41
3 changed files with 10 additions and 7 deletions

View File

@ -749,10 +749,8 @@
flex-grow: 0;
width: auto;
color: var(--color-accent);
}
#tab_bar .project_tab > label.project_tab_session_badge i {
margin-right: 2px;
margin-left: -4px;
flex-shrink: 0;
padding-right: 0;
}
#tab_bar.invisible {
visibility: hidden;

View File

@ -125,7 +125,12 @@ new ModelFormat('image', {
},
new() {
if (newProject(this)) {
TextureGenerator.addBitmapDialog();
TextureGenerator.addBitmapDialog(() => {
setTimeout(() => {
Undo.history.empty();
Undo.index = 0;
}, 1);
});
return true;
}
},

View File

@ -12,7 +12,7 @@ const TextureGenerator = {
west: {c1: '#f48686', c2: '#FFA7A4', place: t => {return {x: t.posx+t.z+t.x, y: t.posy+t.z, w: t.z, h: t.y}}},
south: {c1: '#f8dd72', c2: '#FFF899', place: t => {return {x: t.posx+t.z+t.x+t.z,y: t.posy+t.z, w: t.x, h: t.y}}},
},
addBitmapDialog() {
addBitmapDialog(callback) {
let type_options = {};
if (Format.edit_mode) {
type_options.template = 'dialog.create_texture.type.template'
@ -62,7 +62,7 @@ const TextureGenerator = {
results.resolution = results.resolution_vec;
}
dialog.hide()
TextureGenerator.addBitmap(results);
TextureGenerator.addBitmap(results, callback);
return false;
}
}).show()