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