mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 18:40:12 -05:00
--Bug fixes
-Change variation spin boxes to only show the precision needed, and also allow scientific notation.
This commit is contained in:
parent
cee3ef20d4
commit
4636c1047d
@ -272,7 +272,7 @@
|
||||
<Fragment>
|
||||
<ComponentGroup Id="BenchComponents" Directory="INSTALLFOLDERBENCH">
|
||||
<Component Id="EmberBench.ps1" Guid="a0362c11-e54a-4712-b800-0bb7c43d285e">
|
||||
<File Id="EmberBench.ps1" Source="$(var.SolutionDir)..\..\..\Data\Bench\EmberBench.ps1" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
|
||||
<File Id="EmberBench.ps1" Source="$(var.SolutionDir)..\..\..\Data\Bench\EmberBench.ps1" KeyPath="yes" Checksum="yes" ReadOnly="no"/>
|
||||
</Component>
|
||||
|
||||
<Component Id="golubaja_rippingfrominside_complexcode.flame" Guid="74fc54d8-eb7f-4e88-b839-c6d0b847d78e">
|
||||
|
@ -356,7 +356,7 @@ VariationTreeDoubleSpinBox::VariationTreeDoubleSpinBox(QWidget* p, VariationTree
|
||||
m_WidgetItem = widgetItem;
|
||||
m_Param = param;
|
||||
m_Id = id;
|
||||
setDecimals(3);
|
||||
//setDecimals(3);
|
||||
//PI
|
||||
auto piAction = new QAction("PI", this);
|
||||
connect(piAction, SIGNAL(triggered(bool)), this, SLOT(PiActionTriggered(bool)), Qt::QueuedConnection);
|
||||
@ -407,6 +407,7 @@ VariationTreeDoubleSpinBox::VariationTreeDoubleSpinBox(QWidget* p, VariationTree
|
||||
this->addAction(sqrtThreeAction);
|
||||
//Need this for it to show up properly.
|
||||
this->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
lineEdit()->setValidator(new QDoubleValidator(this));
|
||||
}
|
||||
|
||||
void VariationTreeDoubleSpinBox::PiActionTriggered(bool checked) { setValue(M_PI); }
|
||||
@ -422,6 +423,12 @@ void VariationTreeDoubleSpinBox::FourOverPiActionTriggered(bool checked) { setV
|
||||
void VariationTreeDoubleSpinBox::SqrtTwoActionTriggered(bool checked) { setValue(M_SQRT2); }
|
||||
void VariationTreeDoubleSpinBox::SqrtThreeActionTriggered(bool checked) { setValue(std::sqrt(3.0)); }
|
||||
|
||||
|
||||
QString VariationTreeDoubleSpinBox::textFromValue(double value) const
|
||||
{
|
||||
return QWidget::locale().toString(value, 'g', 10);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor that sets up the context menu for special numerical values specific to affine spinners.
|
||||
/// </summary>
|
||||
|
@ -98,6 +98,7 @@ public:
|
||||
string ParamName() { return m_Param; }
|
||||
eVariationId GetVariationId() { return m_Id; }
|
||||
VariationTreeWidgetItem* WidgetItem() { return m_WidgetItem; }
|
||||
virtual QString textFromValue(double value) const override;
|
||||
|
||||
public slots:
|
||||
void PiActionTriggered(bool checked = false);
|
||||
|
@ -122,7 +122,7 @@ void FractoriumEmberController<T>::SetupVariationsTree()
|
||||
spinBox->DoubleClickZero(1);
|
||||
spinBox->DoubleClickNonZero(0);
|
||||
spinBox->SmallStep(0.001);
|
||||
spinBox->setDecimals(4);
|
||||
//spinBox->setDecimals(4);
|
||||
tree->setItemWidget(item, 1, spinBox);
|
||||
m_Fractorium->connect(spinBox, SIGNAL(valueChanged(double)), SLOT(OnVariationSpinBoxValueChanged(double)), Qt::QueuedConnection);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user