mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-27 16:22:20 +01:00
Merge current dev and refresh PR #6741 from the 7011 integration
This commit is contained in:
@@ -215,7 +215,10 @@ export function wireAIToolsMisc({
|
||||
function addEmptyLayer() {
|
||||
saveState('Add layer');
|
||||
const layer = createLayer('Layer ' + state.layers.length, state.imgWidth, state.imgHeight);
|
||||
state.layers.push(layer);
|
||||
// Photoshop inserts the new layer directly above the selected one.
|
||||
const activeIndex = state.layers.findIndex(item => item.id === state.activeLayerId);
|
||||
const insertIndex = activeIndex >= 0 ? activeIndex + 1 : state.layers.length;
|
||||
state.layers.splice(insertIndex, 0, layer);
|
||||
state.activeLayerId = layer.id;
|
||||
renderLayerPanel();
|
||||
composite();
|
||||
|
||||
Reference in New Issue
Block a user