mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-20 18:40:57 +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);
|
||||
else
|
||||
Preferences::instance().colorBar.boxSize(boxsize);
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -154,7 +154,7 @@ namespace app {
|
||||
// PaletteViewDelegate impl
|
||||
void onPaletteViewIndexChange(int index, ui::MouseButton button) 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;
|
||||
app::Color onPaletteViewGetForegroundIndex() override;
|
||||
app::Color onPaletteViewGetBackgroundIndex() override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// 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);
|
||||
|
||||
if (m_delegate)
|
||||
m_delegate->onPaletteViewChangeSize(int(m_boxsize));
|
||||
m_delegate->onPaletteViewChangeSize(this, int(m_boxsize));
|
||||
|
||||
View* view = View::getView(this);
|
||||
if (view)
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -38,12 +38,14 @@ namespace app {
|
||||
RESIZE,
|
||||
};
|
||||
|
||||
class PaletteView;
|
||||
|
||||
class PaletteViewDelegate {
|
||||
public:
|
||||
virtual ~PaletteViewDelegate() { }
|
||||
virtual void onPaletteViewIndexChange(int index, ui::MouseButton button) { }
|
||||
virtual void onPaletteViewModification(const doc::Palette* newPalette, PaletteViewModification mod) { }
|
||||
virtual void onPaletteViewChangeSize(int boxsize) { }
|
||||
virtual void onPaletteViewChangeSize(PaletteView* paletteView, int boxsize) { }
|
||||
virtual void onPaletteViewPasteColors(
|
||||
const doc::Palette* fromPal, const doc::PalettePicks& from, const doc::PalettePicks& to) { }
|
||||
virtual app::Color onPaletteViewGetForegroundIndex() { return app::Color::fromMask(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user