mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-29 00:23:48 +00:00
Add PalettePicks::invert() member function
This commit is contained in:
parent
de8b6ff2b4
commit
2bc64cf5ff
@ -197,10 +197,8 @@ void SelectPaletteColorsCommand::onExecute(Context* context)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_modifier == Modifier::UnusedColors) {
|
||||
for (int i=0; i<usedEntries.size(); ++i)
|
||||
usedEntries[i] = !usedEntries[i];
|
||||
}
|
||||
if (m_modifier == Modifier::UnusedColors)
|
||||
usedEntries.invert();
|
||||
context->setSelectedColors(usedEntries);
|
||||
}
|
||||
else if (m_modifier == Modifier::UsedTiles ||
|
||||
@ -217,10 +215,8 @@ void SelectPaletteColorsCommand::onExecute(Context* context)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_modifier == Modifier::UnusedTiles) {
|
||||
for (int i=0; i<usedTiles.size(); ++i)
|
||||
usedTiles[i] = !usedTiles[i];
|
||||
}
|
||||
if (m_modifier == Modifier::UnusedTiles)
|
||||
usedTiles.invert();
|
||||
context->setSelectedTiles(usedTiles);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Document Library
|
||||
// Copyright (c) 2019 Igara Studio S.A.
|
||||
// Copyright (c) 2019-2021 Igara Studio S.A.
|
||||
// Copyright (c) 2001-2017 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
@ -80,6 +80,11 @@ namespace doc {
|
||||
return result;
|
||||
}
|
||||
|
||||
void invert() {
|
||||
for (int i=0; i<size(); ++i)
|
||||
m_items[i] = !m_items[i];
|
||||
}
|
||||
|
||||
private:
|
||||
list_type m_items;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user