mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
Fix #2118 Undo in new image project deletes the image
Tab bar CSS improvements
This commit is contained in:
parent
de9b199a97
commit
be39e6af41
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user