mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 05:46:06 -04:00
05/31/2017
--User changes -Add support for adjusting xform color indices in the palette editor. Fixed palettes can now be displayed there, but they will have no color arrows as they are not editable. -Add support for independent dimension scaling in the EmberRender and EmberAnimate programs to bring them in line with the final render dialog Fractorium. --Bug fixes -File paths with a space in them did not work in the command line programs. -Any Xml file in the search paths would erroneously be treated as a palette file. --Code changes -Change some for loops to while loops when iterating through xforms. -Allow FractoriumEmberController<T>::UpdateXform() to be able to apply the action to an xform at a specific index. -Remove old code blocks build files that were never used. -Make GetPath() return empty string if no path is present in the passed in file path. -GetTotalXform() was always counting the final xform, even if it was unused.
This commit is contained in:
@ -317,9 +317,16 @@ void Fractorium::OnPaletteRandomAdjustButtonClicked(bool checked)
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::PaletteEditorButtonClicked()
|
||||
{
|
||||
size_t i = 0;
|
||||
auto ed = m_Fractorium->m_PaletteEditor;
|
||||
Palette<float> prevPal = m_TempPalette;
|
||||
ed->SetPalette(m_TempPalette);
|
||||
map<size_t, float> colorIndices;
|
||||
|
||||
while (auto xform = m_Ember.GetTotalXform(i))
|
||||
colorIndices[i++] = xform->m_ColorX;
|
||||
|
||||
ed->SetColorIndices(colorIndices);
|
||||
|
||||
if (ed->exec() == QDialog::Accepted)
|
||||
{
|
||||
@ -363,8 +370,9 @@ void Fractorium::OnPaletteEditorButtonClicked(bool checked)
|
||||
if (!m_PaletteEditor)
|
||||
{
|
||||
m_PaletteEditor = new PaletteEditor(this);
|
||||
connect(m_PaletteEditor, SIGNAL(PaletteChanged()), this, SLOT(OnPaletteEditorColorChanged()), Qt::QueuedConnection);
|
||||
connect(m_PaletteEditor, SIGNAL(PaletteFileChanged()), this, SLOT(OnPaletteEditorFileChanged()), Qt::QueuedConnection);
|
||||
connect(m_PaletteEditor, SIGNAL(PaletteChanged()), this, SLOT(OnPaletteEditorColorChanged()), Qt::QueuedConnection);
|
||||
connect(m_PaletteEditor, SIGNAL(PaletteFileChanged()), this, SLOT(OnPaletteEditorFileChanged()), Qt::QueuedConnection);
|
||||
connect(m_PaletteEditor, SIGNAL(ColorIndexChanged(size_t, float)), this, SLOT(OnPaletteEditorColorIndexChanged(size_t, float)), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
m_PaletteChanged = false;
|
||||
@ -389,6 +397,25 @@ void Fractorium::OnPaletteEditorFileChanged()
|
||||
m_PaletteFileChanged = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Slot called every time an xform color index is changed in the palette editor.
|
||||
/// If a special value of size_t max is passed for index, it means update all color indices.
|
||||
/// </summary>
|
||||
/// <param name="index">The index of the xform whose color index has been changed. Special value of size_t max to update all</param>
|
||||
/// <param name="value">The value of the color index</param>
|
||||
void Fractorium::OnPaletteEditorColorIndexChanged(size_t index, float value)
|
||||
{
|
||||
if (index == std::numeric_limits<size_t>::max())
|
||||
{
|
||||
auto indices = m_PaletteEditor->GetColorIndices();
|
||||
|
||||
for (auto& it : indices)
|
||||
OnXformColorIndexChanged(it.second, true, eXformUpdate::UPDATE_SPECIFIC, it.first);
|
||||
}
|
||||
else
|
||||
OnXformColorIndexChanged(value, true, eXformUpdate::UPDATE_SPECIFIC, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply the text in the palette filter text box to only show palettes whose names
|
||||
/// contain the substring.
|
||||
|
Reference in New Issue
Block a user