mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-12 16:14:10 +00:00
Fix crash making palette entries too small using scroll wheel
This commit is contained in:
parent
ca1ebf02b5
commit
2995190d00
@ -388,7 +388,7 @@ void ColorBar::setPalette(const doc::Palette* newPalette, const std::string& act
|
||||
|
||||
void ColorBar::onPaletteViewChangeSize(int boxsize)
|
||||
{
|
||||
App::instance()->preferences().colorBar.boxSize(boxsize / guiscale());
|
||||
App::instance()->preferences().colorBar.boxSize(boxsize);
|
||||
}
|
||||
|
||||
void ColorBar::onFgColorButtonChange(const app::Color& color)
|
||||
|
@ -179,15 +179,13 @@ int PaletteView::getBoxSize() const
|
||||
void PaletteView::setBoxSize(int boxsize)
|
||||
{
|
||||
m_boxsize = MID(4*guiscale(), boxsize, 32*guiscale());
|
||||
m_boxsize = boxsize * guiscale();
|
||||
|
||||
if (m_delegate)
|
||||
m_delegate->onPaletteViewChangeSize(m_boxsize);
|
||||
m_delegate->onPaletteViewChangeSize(m_boxsize / guiscale());
|
||||
|
||||
View* view = View::getView(this);
|
||||
if (view)
|
||||
view->layout();
|
||||
|
||||
}
|
||||
|
||||
bool PaletteView::onProcessMessage(Message* msg)
|
||||
@ -265,7 +263,7 @@ bool PaletteView::onProcessMessage(Message* msg)
|
||||
|
||||
if (msg->onlyCtrlPressed()) {
|
||||
int z = delta.x - delta.y;
|
||||
setBoxSize(m_boxsize + z * guiscale());
|
||||
setBoxSize(m_boxsize / guiscale() + z);
|
||||
}
|
||||
else {
|
||||
gfx::Point scroll = view->getViewScroll();
|
||||
|
Loading…
x
Reference in New Issue
Block a user