mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-01 10:13:22 +00:00
Change current palette after undo/redo
This commit is contained in:
parent
c56d3d1170
commit
76afcfedac
@ -27,6 +27,7 @@
|
|||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
#include "app/modules/editors.h"
|
#include "app/modules/editors.h"
|
||||||
#include "app/modules/gui.h"
|
#include "app/modules/gui.h"
|
||||||
|
#include "app/modules/palettes.h"
|
||||||
#include "app/ui/editor/editor.h"
|
#include "app/ui/editor/editor.h"
|
||||||
#include "app/ui/status_bar.h"
|
#include "app/ui/status_bar.h"
|
||||||
#include "base/thread.h"
|
#include "base/thread.h"
|
||||||
@ -117,6 +118,7 @@ void UndoCommand::onExecute(Context* context)
|
|||||||
document->destroyExtraCel(); // Regenerate extras
|
document->destroyExtraCel(); // Regenerate extras
|
||||||
|
|
||||||
update_screen_for_document(document);
|
update_screen_for_document(document);
|
||||||
|
set_current_palette(writer.palette(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createUndoCommand()
|
Command* CommandFactory::createUndoCommand()
|
||||||
|
@ -51,6 +51,10 @@ namespace app {
|
|||||||
return m_location.image(x, y, opacity);
|
return m_location.image(x, y, opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Palette* palette() const {
|
||||||
|
return m_location.palette();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ContextAccess(const Context* context)
|
ContextAccess(const Context* context)
|
||||||
: m_context(context)
|
: m_context(context)
|
||||||
|
@ -84,4 +84,9 @@ Image* DocumentLocation::image(int* x, int* y, int* opacity) const
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Palette* DocumentLocation::palette() const
|
||||||
|
{
|
||||||
|
return (m_sprite ? m_sprite->getPalette(m_frame): NULL);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
@ -67,6 +67,7 @@ namespace app {
|
|||||||
void layerIndex(LayerIndex layerIndex);
|
void layerIndex(LayerIndex layerIndex);
|
||||||
Palette* palette();
|
Palette* palette();
|
||||||
Image* image(int* x = NULL, int* y = NULL, int* opacity = NULL) const;
|
Image* image(int* x = NULL, int* y = NULL, int* opacity = NULL) const;
|
||||||
|
Palette* palette() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Document* m_document;
|
Document* m_document;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user