mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 03:32:48 +00:00
Fix bug where the palette weren't updated on the screen after converting the sprite color space
This commit is contained in:
parent
4487c3d35f
commit
6542008aef
@ -578,8 +578,7 @@ InputChain& App::inputChain()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Updates palette and redraw the screen.
|
void app_update_current_palette()
|
||||||
void app_refresh_screen()
|
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
Context* context = UIContext::instance();
|
Context* context = UIContext::instance();
|
||||||
@ -590,7 +589,15 @@ void app_refresh_screen()
|
|||||||
if (Palette* pal = site.palette())
|
if (Palette* pal = site.palette())
|
||||||
set_current_palette(pal, false);
|
set_current_palette(pal, false);
|
||||||
else
|
else
|
||||||
set_current_palette(NULL, false);
|
set_current_palette(nullptr, false);
|
||||||
|
#endif // ENABLE_UI
|
||||||
|
}
|
||||||
|
|
||||||
|
// Updates palette and redraw the screen.
|
||||||
|
void app_refresh_screen()
|
||||||
|
{
|
||||||
|
#ifdef ENABLE_UI
|
||||||
|
app_update_current_palette();
|
||||||
|
|
||||||
// Invalidate the whole screen.
|
// Invalidate the whole screen.
|
||||||
ui::Manager::getDefault()->invalidate();
|
ui::Manager::getDefault()->invalidate();
|
||||||
|
@ -147,6 +147,7 @@ namespace app {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void app_update_current_palette();
|
||||||
void app_refresh_screen();
|
void app_refresh_screen();
|
||||||
void app_rebuild_documents_tabs();
|
void app_rebuild_documents_tabs();
|
||||||
PixelFormat app_get_current_pixel_format();
|
PixelFormat app_get_current_pixel_format();
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "doc/sprite.h"
|
#include "doc/sprite.h"
|
||||||
#include "os/display.h"
|
#include "os/display.h"
|
||||||
#include "os/system.h"
|
#include "os/system.h"
|
||||||
|
#include "ui/system.h"
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -508,6 +509,14 @@ void Doc::updateOSColorSpace(bool appWideSignal)
|
|||||||
context()->activeDocument() == this) {
|
context()->activeDocument() == this) {
|
||||||
App::instance()->ColorSpaceChange();
|
App::instance()->ColorSpaceChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ui::is_ui_thread()) {
|
||||||
|
// As the color space has changed, we might need to upate the
|
||||||
|
// current palette (because the color space conversion might be
|
||||||
|
// came from a cmd::ConvertColorProfile, so the palette might be
|
||||||
|
// changed). This might generate a PaletteChange() signal.
|
||||||
|
app_update_current_palette();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
Loading…
x
Reference in New Issue
Block a user