mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Fix bug showing invalid layer name in Layer Props dialog after "New Layer" command
This commit is contained in:
parent
5dfe7b64ae
commit
214f886a0e
@ -294,7 +294,7 @@ void ImportSpriteSheetCommand::onExecute(Context* context)
|
||||
DocumentApi api = document->getApi(transaction);
|
||||
|
||||
// Add the layer in the sprite.
|
||||
LayerImage* resultLayer = api.newLayer(sprite);
|
||||
LayerImage* resultLayer = api.newLayer(sprite, "Sprite Sheet");
|
||||
|
||||
// Add all frames+cels to the new layer
|
||||
for (size_t i=0; i<animation.size(); ++i) {
|
||||
|
@ -107,7 +107,7 @@ void NewLayerCommand::onExecute(Context* context)
|
||||
{
|
||||
Transaction transaction(writer.context(), "New Layer");
|
||||
DocumentApi api = document->getApi(transaction);
|
||||
layer = api.newLayer(sprite);
|
||||
layer = api.newLayer(sprite, name);
|
||||
|
||||
// If "top" parameter is false, create the layer above the active
|
||||
// one.
|
||||
@ -116,7 +116,6 @@ void NewLayerCommand::onExecute(Context* context)
|
||||
|
||||
transaction.commit();
|
||||
}
|
||||
layer->setName(name);
|
||||
update_screen_for_document(document);
|
||||
|
||||
StatusBar::instance()->invalidate();
|
||||
|
@ -392,9 +392,10 @@ void DocumentApi::swapCel(
|
||||
if (cel2) setCelFramePosition(cel2, frame1);
|
||||
}
|
||||
|
||||
LayerImage* DocumentApi::newLayer(Sprite* sprite)
|
||||
LayerImage* DocumentApi::newLayer(Sprite* sprite, const std::string& name)
|
||||
{
|
||||
LayerImage* layer = new LayerImage(sprite);
|
||||
layer->setName(name);
|
||||
|
||||
addLayer(sprite->folder(), layer,
|
||||
sprite->folder()->getLastLayer());
|
||||
|
@ -80,7 +80,7 @@ namespace app {
|
||||
LayerImage* layer, frame_t frame1, frame_t frame2);
|
||||
|
||||
// Layers API
|
||||
LayerImage* newLayer(Sprite* sprite);
|
||||
LayerImage* newLayer(Sprite* sprite, const std::string& name);
|
||||
LayerFolder* newLayerFolder(Sprite* sprite);
|
||||
void addLayer(LayerFolder* folder, Layer* newLayer, Layer* afterThis);
|
||||
void removeLayer(Layer* layer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user