mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-02 22:34:52 -04:00
--User changes
-Add a palette editor. -Add support for reading .ugr/.gradient/.gradients palette files. -Allow toggling on spinners whose minimum value is not zero. -Allow toggling display of image, affines and grid. -Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial. --Bug fixes -cpow2 was wrong. -Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3. -Use exec() on Apple and show() on all other OSes for dialog boxes. -Trying to render a sequence with no frames would crash. -Selecting multiple xforms and rotating them would produce the wrong rotation. -Better handling when parsing flames using different encoding, such as unicode and UTF-8. -Switching between SP/DP didn't reselect the selected flame in the Library tab. --Code changes -Make all types concerning palettes be floats, including PaletteTableWidgetItem. -PaletteTableWidgetItem is no longer templated because all palettes are float. -Include the source colors for user created gradients. -Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems. -Split conditional out of accumulation loop on the CPU for better performance. -Vectorize summing when doing density filter for better performance. -Make all usage of palettes be of type float, double is pointless. -Allow palettes to reside in multiple folders, while ensuring only one of each name is added. -Refactor some palette path searching code. -Make ReadFile() throw and catch an exception if the file operation fails. -A little extra safety in foci and foci3D with a call to Zeps(). -Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac. -Fixing missing comma between paths in InitPaletteList(). -Move Xml and PaletteList classes into cpp to shorten build times when working on them. -Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file. -Change more NULL to nullptr.
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
#include "FractoriumPch.h"
|
||||
#include "DoubleSpinBox.h"
|
||||
#include "FractoriumSettings.h"
|
||||
|
||||
QTimer DoubleSpinBox::s_Timer;
|
||||
|
||||
@ -17,10 +16,12 @@ DoubleSpinBox::DoubleSpinBox(QWidget* p, int h, double step)
|
||||
: QDoubleSpinBox(p)
|
||||
{
|
||||
m_DoubleClick = false;
|
||||
m_DoubleClickLowVal = 0;
|
||||
m_DoubleClickNonZero = 0;
|
||||
m_DoubleClickZero = 1;
|
||||
m_Step = step;
|
||||
m_SmallStep = step / 10.0;
|
||||
m_Settings = FractoriumSettings::DefInstance();
|
||||
setSingleStep(step);
|
||||
setFrame(false);
|
||||
setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
@ -53,6 +54,16 @@ void DoubleSpinBox::DoubleClick(bool b)
|
||||
m_DoubleClick = b;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the value to be used instead of zero to represent the lower value
|
||||
/// used when responding to a double click.
|
||||
/// </summary>
|
||||
/// <param name="val">The value to be used for the lower value instead of zero</param>
|
||||
void DoubleSpinBox::DoubleClickLowVal(double val)
|
||||
{
|
||||
m_DoubleClickLowVal = val;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the value to be used when the user double clicks the spinner while
|
||||
/// it contains zero.
|
||||
@ -120,7 +131,7 @@ QLineEdit* DoubleSpinBox::lineEdit()
|
||||
/// <summary>
|
||||
/// Another workaround for the persistent text selection bug in Qt.
|
||||
/// </summary>
|
||||
void DoubleSpinBox::OnSpinBoxValueChanged(double d)
|
||||
void DoubleSpinBox::OnSpinBoxValueChanged(double)
|
||||
{
|
||||
lineEdit()->deselect();//Gets rid of nasty "feature" that always has text selected.
|
||||
}
|
||||
@ -159,35 +170,34 @@ void DoubleSpinBox::OnTimeout()
|
||||
bool DoubleSpinBox::eventFilter(QObject* o, QEvent* e)
|
||||
{
|
||||
QMouseEvent* me = dynamic_cast<QMouseEvent*>(e);
|
||||
auto settings = FractoriumSettings::DefInstance();
|
||||
|
||||
if (isEnabled() && me)
|
||||
{
|
||||
if (!settings->ToggleType() &&//Ensure double click toggles, not right click.
|
||||
if (!m_Settings->ToggleType() &&//Ensure double click toggles, not right click.
|
||||
me->type() == QMouseEvent::MouseButtonPress &&
|
||||
me->button() == Qt::RightButton)
|
||||
{
|
||||
m_MouseDownPoint = m_MouseMovePoint = me->pos();
|
||||
StartTimer();
|
||||
}
|
||||
else if (!settings->ToggleType() &&
|
||||
else if (!m_Settings->ToggleType() &&
|
||||
me->type() == QMouseEvent::MouseButtonRelease &&
|
||||
me->button() == Qt::RightButton)
|
||||
{
|
||||
StopTimer();
|
||||
m_MouseDownPoint = m_MouseMovePoint = me->pos();
|
||||
}
|
||||
else if (!settings->ToggleType() &&
|
||||
else if (!m_Settings->ToggleType() &&
|
||||
me->type() == QMouseEvent::MouseMove &&
|
||||
QGuiApplication::mouseButtons() & Qt::RightButton)
|
||||
{
|
||||
m_MouseMovePoint = me->pos();
|
||||
}
|
||||
else if (m_DoubleClick &&
|
||||
((!settings->ToggleType() && e->type() == QMouseEvent::MouseButtonDblClick && me->button() == Qt::LeftButton) ||
|
||||
(settings->ToggleType() && me->type() == QMouseEvent::MouseButtonRelease && me->button() == Qt::RightButton)))
|
||||
((!m_Settings->ToggleType() && e->type() == QMouseEvent::MouseButtonDblClick && me->button() == Qt::LeftButton) ||
|
||||
(m_Settings->ToggleType() && me->type() == QMouseEvent::MouseButtonRelease && me->button() == Qt::RightButton)))
|
||||
{
|
||||
if (IsNearZero(value()))
|
||||
if (IsClose(m_DoubleClickLowVal, value()))
|
||||
setValue(m_DoubleClickZero);
|
||||
else
|
||||
setValue(m_DoubleClickNonZero);
|
||||
@ -276,4 +286,4 @@ void DoubleSpinBox::StopTimer()
|
||||
{
|
||||
s_Timer.stop();
|
||||
disconnect(&s_Timer, SIGNAL(timeout()), this, SLOT(OnTimeout()));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user