mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 23:09:58 +00:00
Fix colorbar palette indicator when view is changed (fix #3082)
The foreground/background color indicators in the ColorBar weren't visible in certain scenarios e.g. If we choose the Tiles mode in a tilemap, and then we select a regular layer without changing to Pixels mode. Co-authored-by: David Capello <david@igarastudio.com>
This commit is contained in:
parent
91c687b1e3
commit
539e115b7d
@ -971,9 +971,20 @@ void ColorBar::onRemapTilesButtonClick()
|
||||
|
||||
bool ColorBar::onIsPaletteViewActive(PaletteView* paletteView) const
|
||||
{
|
||||
if (paletteView == &m_paletteView) {
|
||||
return
|
||||
(paletteView == &m_paletteView && m_tilemapMode == TilemapMode::Pixels) ||
|
||||
(paletteView == &m_tilesView && m_tilemapMode == TilemapMode::Tiles);
|
||||
(m_tilemapMode == TilemapMode::Pixels) ||
|
||||
// As the m_tilemapMode value is kept to restore it if we go
|
||||
// back to a tilemap layer, there is a possibility where we are
|
||||
// in a regular layer with the tiles mode enabled (because we
|
||||
// were in a tilemap layer just right before). We have to check
|
||||
// this special case where we are in "tiles mode" but we are
|
||||
// actually in a regular layer (canEditTiles() is false).
|
||||
(m_tilemapMode == TilemapMode::Tiles && !canEditTiles());
|
||||
}
|
||||
else if (paletteView == &m_tilesView) {
|
||||
return (m_tilemapMode == TilemapMode::Tiles);
|
||||
}
|
||||
}
|
||||
|
||||
void ColorBar::onPaletteViewIndexChange(int index, ui::MouseButton button)
|
||||
|
Loading…
Reference in New Issue
Block a user