mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-21 21:41:02 +00:00
Fix bug where F5 was resetting the color bar box size/zoom
This commit is contained in:
parent
9c5b856aef
commit
19d7566249
@ -1016,9 +1016,9 @@ void ColorBar::setTransparentIndex(int index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorBar::onPaletteViewChangeSize(int boxsize)
|
void ColorBar::onPaletteViewChangeSize(PaletteView* paletteView, int boxsize)
|
||||||
{
|
{
|
||||||
if (tilemapMode() == TilemapMode::Tiles)
|
if (paletteView == &m_tilesView)
|
||||||
Preferences::instance().colorBar.tilesBoxSize(boxsize);
|
Preferences::instance().colorBar.tilesBoxSize(boxsize);
|
||||||
else
|
else
|
||||||
Preferences::instance().colorBar.boxSize(boxsize);
|
Preferences::instance().colorBar.boxSize(boxsize);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -154,7 +154,7 @@ namespace app {
|
|||||||
// PaletteViewDelegate impl
|
// PaletteViewDelegate impl
|
||||||
void onPaletteViewIndexChange(int index, ui::MouseButton button) override;
|
void onPaletteViewIndexChange(int index, ui::MouseButton button) override;
|
||||||
void onPaletteViewModification(const doc::Palette* newPalette, PaletteViewModification mod) override;
|
void onPaletteViewModification(const doc::Palette* newPalette, PaletteViewModification mod) override;
|
||||||
void onPaletteViewChangeSize(int boxsize) override;
|
void onPaletteViewChangeSize(PaletteView* paletteView, int boxsize) override;
|
||||||
void onPaletteViewPasteColors(const Palette* fromPal, const doc::PalettePicks& from, const doc::PalettePicks& to) override;
|
void onPaletteViewPasteColors(const Palette* fromPal, const doc::PalettePicks& from, const doc::PalettePicks& to) override;
|
||||||
app::Color onPaletteViewGetForegroundIndex() override;
|
app::Color onPaletteViewGetForegroundIndex() override;
|
||||||
app::Color onPaletteViewGetBackgroundIndex() override;
|
app::Color onPaletteViewGetBackgroundIndex() override;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -534,7 +534,7 @@ void PaletteView::setBoxSize(double boxsize)
|
|||||||
m_boxsize = base::clamp(boxsize, 4.0, 32.0);
|
m_boxsize = base::clamp(boxsize, 4.0, 32.0);
|
||||||
|
|
||||||
if (m_delegate)
|
if (m_delegate)
|
||||||
m_delegate->onPaletteViewChangeSize(int(m_boxsize));
|
m_delegate->onPaletteViewChangeSize(this, int(m_boxsize));
|
||||||
|
|
||||||
View* view = View::getView(this);
|
View* view = View::getView(this);
|
||||||
if (view)
|
if (view)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -38,12 +38,14 @@ namespace app {
|
|||||||
RESIZE,
|
RESIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PaletteView;
|
||||||
|
|
||||||
class PaletteViewDelegate {
|
class PaletteViewDelegate {
|
||||||
public:
|
public:
|
||||||
virtual ~PaletteViewDelegate() { }
|
virtual ~PaletteViewDelegate() { }
|
||||||
virtual void onPaletteViewIndexChange(int index, ui::MouseButton button) { }
|
virtual void onPaletteViewIndexChange(int index, ui::MouseButton button) { }
|
||||||
virtual void onPaletteViewModification(const doc::Palette* newPalette, PaletteViewModification mod) { }
|
virtual void onPaletteViewModification(const doc::Palette* newPalette, PaletteViewModification mod) { }
|
||||||
virtual void onPaletteViewChangeSize(int boxsize) { }
|
virtual void onPaletteViewChangeSize(PaletteView* paletteView, int boxsize) { }
|
||||||
virtual void onPaletteViewPasteColors(
|
virtual void onPaletteViewPasteColors(
|
||||||
const doc::Palette* fromPal, const doc::PalettePicks& from, const doc::PalettePicks& to) { }
|
const doc::Palette* fromPal, const doc::PalettePicks& from, const doc::PalettePicks& to) { }
|
||||||
virtual app::Color onPaletteViewGetForegroundIndex() { return app::Color::fromMask(); }
|
virtual app::Color onPaletteViewGetForegroundIndex() { return app::Color::fromMask(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user