Fix crash when selecting pure black in the color picker when the recent colors list isn't full
Originally committed to SVN as r6534.
This commit is contained in:
parent
110c2358a6
commit
bb9859c70f
1 changed files with 5 additions and 2 deletions
|
@ -470,8 +470,11 @@ wxString ColorPickerRecent::StoreToString()
|
|||
|
||||
void ColorPickerRecent::AddColor(wxColour color)
|
||||
{
|
||||
colors.erase(remove(colors.begin(), colors.end(), color), colors.end());
|
||||
colors.insert(colors.begin(), color);
|
||||
std::vector<wxColour>::iterator existing = find(colors.begin(), colors.end(), color);
|
||||
if (existing != colors.end())
|
||||
rotate(colors.begin(), existing, existing + 1);
|
||||
else
|
||||
colors.insert(colors.begin(), color);
|
||||
|
||||
background_valid = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue