Solving Gnome Palette Editor problem

This commit is contained in:
Michel Mastriani
2019-05-19 18:10:56 -03:00
parent 4550f9dc87
commit 2d2d561e29
5 changed files with 94 additions and 4 deletions

View File

@ -117,6 +117,17 @@ map<size_t, float> PaletteEditor::GetColorIndices() const
return m_GradientColorView->GetColorIndices();
}
// michel
/// <summary>
/// Return the previous xform color indices as a map.
/// The keys are the xform indices, and the values are the color indices.
/// </summary>
/// <returns>The color indices</returns>
map<size_t, float> PaletteEditor::GetPreviousColorIndices() const
{
return m_PreviousColorIndices;
}
/// <summary>
/// Assign the values of the xform color indices to the arrows.
/// This will clear out any existing values first.
@ -127,6 +138,16 @@ void PaletteEditor::SetColorIndices(const map<size_t, float>& indices)
m_GradientColorView->SetColorIndices(indices);
}
// michel
/// <summary>
/// Backup xform color
/// </summary>
/// <param name="indices">The color indices to backup</param>
void PaletteEditor::SetPreviousColorIndices(const map<size_t, float>& indices)
{
m_PreviousColorIndices = indices;
}
/// <summary>
/// Return the filename of the currently selected palette.
/// Note this will only be filled in if the user has clicked in the palette
@ -636,4 +657,4 @@ void PaletteEditor::EnablePaletteControls()
bool PaletteEditor::IsCurrentPaletteAndFileEditable()
{
return m_PaletteList->IsModifiable(m_CurrentPaletteFilePath) && !m_GradientColorView->GetPalette(256).m_SourceColors.empty();
}
}