mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 15:20:15 +00:00
Change ColorMap::m_remap to UniquePtr
This commit is contained in:
parent
85d638097b
commit
5fc3b06e8e
@ -109,7 +109,6 @@ ColorBar::ColorBar(int align)
|
|||||||
, m_bgColor(app::Color::fromRgb(0, 0, 0), IMAGE_RGB)
|
, m_bgColor(app::Color::fromRgb(0, 0, 0), IMAGE_RGB)
|
||||||
, m_lock(false)
|
, m_lock(false)
|
||||||
, m_syncingWithPref(false)
|
, m_syncingWithPref(false)
|
||||||
, m_remap(nullptr)
|
|
||||||
, m_lastDocument(nullptr)
|
, m_lastDocument(nullptr)
|
||||||
, m_ascending(true)
|
, m_ascending(true)
|
||||||
{
|
{
|
||||||
@ -406,7 +405,7 @@ void ColorBar::onPaletteViewRemapColors(const Remap& remap, const Palette* newPa
|
|||||||
void ColorBar::applyRemap(const doc::Remap& remap, const doc::Palette* newPalette, const std::string& actionText)
|
void ColorBar::applyRemap(const doc::Remap& remap, const doc::Palette* newPalette, const std::string& actionText)
|
||||||
{
|
{
|
||||||
if (!m_remap) {
|
if (!m_remap) {
|
||||||
m_remap = new doc::Remap(remap);
|
m_remap.reset(new doc::Remap(remap));
|
||||||
m_remapButton.setVisible(true);
|
m_remapButton.setVisible(true);
|
||||||
layout();
|
layout();
|
||||||
}
|
}
|
||||||
@ -681,9 +680,7 @@ void ColorBar::destroyRemap()
|
|||||||
if (!m_remap)
|
if (!m_remap)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
delete m_remap;
|
m_remap.reset();
|
||||||
m_remap = nullptr;
|
|
||||||
|
|
||||||
m_remapButton.setVisible(false);
|
m_remapButton.setVisible(false);
|
||||||
layout();
|
layout();
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ namespace app {
|
|||||||
ColorButton m_bgColor;
|
ColorButton m_bgColor;
|
||||||
bool m_lock;
|
bool m_lock;
|
||||||
bool m_syncingWithPref;
|
bool m_syncingWithPref;
|
||||||
doc::Remap* m_remap;
|
base::UniquePtr<doc::Remap> m_remap;
|
||||||
const doc::Document* m_lastDocument;
|
const doc::Document* m_lastDocument;
|
||||||
bool m_ascending;
|
bool m_ascending;
|
||||||
ScopedConnection m_conn;
|
ScopedConnection m_conn;
|
||||||
|
Loading…
Reference in New Issue
Block a user