diff --git a/Builds/MSVC/Installer/FractoriumInstaller.wixproj b/Builds/MSVC/Installer/FractoriumInstaller.wixproj index 8e44abd..ac72ce1 100644 --- a/Builds/MSVC/Installer/FractoriumInstaller.wixproj +++ b/Builds/MSVC/Installer/FractoriumInstaller.wixproj @@ -6,7 +6,7 @@ 3.7 {c8096c47-e358-438c-a520-146d46b0637d} 2.0 - Fractorium_1.0.0.10 + Fractorium_1.0.0.11 Package $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets diff --git a/Builds/MSVC/Installer/Product.wxs b/Builds/MSVC/Installer/Product.wxs index a4abfeb..7ce8000 100644 --- a/Builds/MSVC/Installer/Product.wxs +++ b/Builds/MSVC/Installer/Product.wxs @@ -1,6 +1,6 @@ - + @@ -13,7 +13,7 @@ - + ::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way. #define ISAAC_SIZE 4 diff --git a/Source/Fractorium/AboutDialog.ui b/Source/Fractorium/AboutDialog.ui index 4543f6c..cbf4da2 100644 --- a/Source/Fractorium/AboutDialog.ui +++ b/Source/Fractorium/AboutDialog.ui @@ -58,7 +58,7 @@ QFrame::NoFrame - <html><head/><body><p align="center">Fractorium 1.0.0.10</p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" text-decoration: underline; color:#0000ff;">fractorium.com</span></a><span style=" font-size:10pt;"><br/>Lead: Matt Feemster<br/>Contributors: Simon Detheridge, Michel Mastriani</span></p></body></html> + <html><head/><body><p align="center">Fractorium 1.0.0.11</p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" text-decoration: underline; color:#0000ff;">fractorium.com</span></a><span style=" font-size:10pt;"><br/>Lead: Matt Feemster<br/>Contributors: Simon Detheridge, Michel Mastriani</span></p></body></html> Qt::RichText diff --git a/Source/Fractorium/FractoriumEmberController.h b/Source/Fractorium/FractoriumEmberController.h index bca490a..91e0c2a 100644 --- a/Source/Fractorium/FractoriumEmberController.h +++ b/Source/Fractorium/FractoriumEmberController.h @@ -148,6 +148,7 @@ public: virtual void PaletteModeChanged(uint i) { } virtual void WidthChanged(uint i) { } virtual void HeightChanged(uint i) { } + virtual void ResizeAndScale(int width, int height, eScaleType scaleType) { } virtual void CenterXChanged(double d) { } virtual void CenterYChanged(double d) { } virtual void ScaleChanged(double d) { } @@ -413,6 +414,7 @@ public: virtual void PaletteModeChanged(uint i) override; virtual void WidthChanged(uint i) override; virtual void HeightChanged(uint i) override; + virtual void ResizeAndScale(int width, int height, eScaleType scaleType) override; virtual void CenterXChanged(double d) override; virtual void CenterYChanged(double d) override; virtual void ScaleChanged(double d) override; diff --git a/Source/Fractorium/FractoriumParams.cpp b/Source/Fractorium/FractoriumParams.cpp index 658a586..c9211d0 100644 --- a/Source/Fractorium/FractoriumParams.cpp +++ b/Source/Fractorium/FractoriumParams.cpp @@ -50,12 +50,22 @@ void Fractorium::InitParamsUI() SetupSpinner(table, this, row, 1, m_CenterYSpin, spinHeight, -dmax, dmax, 0.05, SIGNAL(valueChanged(double)), SLOT(OnCenterYChanged(double)), true, 0, 0, 0); SetupSpinner(table, this, row, 1, m_ScaleSpin, spinHeight, 10, dmax, 20, SIGNAL(valueChanged(double)), SLOT(OnScaleChanged(double)), true, 240, 240, 240); SetupSpinner(table, this, row, 1, m_ZoomSpin, spinHeight, 0, 25, 0.2, SIGNAL(valueChanged(double)), SLOT(OnZoomChanged(double)), true, 0, 0, 0); - SetupSpinner(table, this, row, 1, m_RotateSpin, spinHeight, -180, 180, 10, SIGNAL(valueChanged(double)), SLOT(OnRotateChanged(double)), true, 0, 0, 0); + SetupSpinner(table, this, row, 1, m_RotateSpin, spinHeight, -180, 180, 10, SIGNAL(valueChanged(double)), SLOT(OnRotateChanged(double)), true, 0, 0, 0); SetupSpinner(table, this, row, 1, m_ZPosSpin, spinHeight, -1000, 1000, 1, SIGNAL(valueChanged(double)), SLOT(OnZPosChanged(double)), true, 0, 1, 0); SetupSpinner(table, this, row, 1, m_PerspectiveSpin, spinHeight, -500, 500, 0.01, SIGNAL(valueChanged(double)), SLOT(OnPerspectiveChanged(double)), true, 0, 1, 0); SetupSpinner(table, this, row, 1, m_PitchSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnPitchChanged(double)), true, 0, 45, 0); SetupSpinner(table, this, row, 1, m_YawSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnYawChanged(double)), true, 0, 45, 0); SetupSpinner(table, this, row, 1, m_DepthBlurSpin, spinHeight, -dmax, dmax, 0.01, SIGNAL(valueChanged(double)), SLOT(OnDepthBlurChanged(double)), true, 0, 1, 0); + m_WidthSpin->m_DoubleClickNonZeroEvent = [&](SpinBox * sb, int val) + { + m_Controller->ResizeAndScale(val, m_HeightSpin->DoubleClickNonZero(), eScaleType::SCALE_WIDTH); + m_HeightSpin->SetValueStealth(m_HeightSpin->DoubleClickNonZero()); + }; + m_HeightSpin->m_DoubleClickNonZeroEvent = [&](SpinBox * sb, int val) + { + m_Controller->ResizeAndScale(m_WidthSpin->DoubleClickNonZero(), val, eScaleType::SCALE_HEIGHT); + m_WidthSpin->SetValueStealth(m_WidthSpin->DoubleClickNonZero()); + }; //Set w/h max values. m_CenterXSpin->setDecimals(3); m_CenterYSpin->setDecimals(3); @@ -252,10 +262,11 @@ void Fractorium::OnPaletteModeComboCurrentIndexChanged(int index) { m_Controller /// /// -/// Placeholder, do nothing. -/// Dimensions are set automatically to match the dimensions of GLWidget. +/// Set the width of the ember in pixels to the passed in value. +/// Called when the width spinner is changed in a manner other than double clicking. +/// Resets the rendering process. /// -/// Ignored +/// The width value in pixels to set template void FractoriumEmberController::WidthChanged(uint i) { UpdateAll([&](Ember& ember, bool isMain) @@ -263,13 +274,15 @@ template void FractoriumEmberController::WidthChanged(uint i) ember.m_FinalRasW = i; }, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll()); } + void Fractorium::OnWidthChanged(int i) { m_Controller->WidthChanged(i); } /// -/// Placeholder, do nothing. -/// Dimensions are set automatically to match the dimensions of GLWidget. +/// Set the height of the ember in pixels to the passed in value. +/// Called when the height spinner is changed in a manner other than double clicking. +/// Resets the rendering process. /// -/// Ignored +/// The height value in pixels to set template void FractoriumEmberController::HeightChanged(uint i) { UpdateAll([&](Ember& ember, bool isMain) @@ -277,8 +290,31 @@ template void FractoriumEmberController::HeightChanged(uint i) ember.m_FinalRasH = i; }, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll()); } + void Fractorium::OnHeightChanged(int i) { m_Controller->HeightChanged(i); } +/// +/// Set the width and height of the ember in pixels to the passed in values. +/// Called when either the width or height spinners are double clicked. +/// Because this will change the scale value, the scale spinner gets a stealth update. +/// For this reason, the affine scales are reset, even though they are not when doing a manual +/// height or width adjustment. +/// Resets the rendering process. +/// +/// The width value in pixels to set +/// The height value in pixels to set +/// The height value in pixels to set +template +void FractoriumEmberController::ResizeAndScale(int width, int height, eScaleType scaleType) +{ + UpdateAll([&](Ember& ember, bool isMain) + { + m_Ember.SetSizeAndAdjustScale(width, height, false, scaleType); + }, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll()); + m_Fractorium->m_ScaleSpin->SetValueStealth(m_Ember.m_PixelsPerUnit); + m_Fractorium->OnActionResetScale(true); +} + /// /// Set the x offset applied to the center of the image. /// Resets the rendering process. diff --git a/Source/Fractorium/FractoriumToolbar.cpp b/Source/Fractorium/FractoriumToolbar.cpp index ebad1ad..c8f8385 100644 --- a/Source/Fractorium/FractoriumToolbar.cpp +++ b/Source/Fractorium/FractoriumToolbar.cpp @@ -154,6 +154,7 @@ void Fractorium::OnActionDrawImage(bool checked) /// Check state, show grid if true, else hide. void Fractorium::OnActionDrawGrid(bool checked) { + m_Settings->ShowGrid(checked); ui.GLDisplay->update(); } diff --git a/Source/Fractorium/GLWidget.cpp b/Source/Fractorium/GLWidget.cpp index cdba23a..6398382 100644 --- a/Source/Fractorium/GLWidget.cpp +++ b/Source/Fractorium/GLWidget.cpp @@ -1077,7 +1077,10 @@ void GLEmberController::Wheel(QWheelEvent* e) void GLWidget::wheelEvent(QWheelEvent* e) { if (auto controller = GLController()) + { controller->Wheel(e); + e->accept();//Prevents it from being sent to the main scroll bars. Scrolling should only affect the scale parameter and affine display zooming. + } //Do not call QOpenGLWidget::wheelEvent(e) because this should only affect the scale and not the position of the scroll bars. } diff --git a/Source/Fractorium/SpinBox.cpp b/Source/Fractorium/SpinBox.cpp index f42e85a..9af98d1 100644 --- a/Source/Fractorium/SpinBox.cpp +++ b/Source/Fractorium/SpinBox.cpp @@ -66,6 +66,11 @@ void SpinBox::DoubleClickLowVal(int val) m_DoubleClickLowVal = val; } +int SpinBox::DoubleClickLowVal() +{ + return m_DoubleClickLowVal; +} + /// /// Set the value to be used when the user double clicks the spinner while /// it contains zero. @@ -76,6 +81,11 @@ void SpinBox::DoubleClickZero(int val) m_DoubleClickZero = val; } +int SpinBox::DoubleClickZero() +{ + return m_DoubleClickZero; +} + /// /// Set the value to be used when the user double clicks the spinner while /// it contains a non-zero value. @@ -86,6 +96,11 @@ void SpinBox::DoubleClickNonZero(int val) m_DoubleClickNonZero = val; } +int SpinBox::DoubleClickNonZero() +{ + return m_DoubleClickNonZero; +} + /// /// Set the small step to be used when the user holds down shift while scrolling. /// The default is step / 10, so use this if something else is needed. @@ -175,9 +190,15 @@ bool SpinBox::eventFilter(QObject* o, QEvent* e) (m_Settings->ToggleType() && me->type() == QMouseEvent::MouseButtonRelease && me->button() == Qt::RightButton))) { if (IsClose(m_DoubleClickLowVal, value())) + { + m_DoubleClickZeroEvent(this, m_DoubleClickZero); setValue(m_DoubleClickZero); + } else + { + m_DoubleClickNonZeroEvent(this, m_DoubleClickNonZero); setValue(m_DoubleClickNonZero); + } } } else diff --git a/Source/Fractorium/SpinBox.h b/Source/Fractorium/SpinBox.h index 4e6f169..d62d973 100644 --- a/Source/Fractorium/SpinBox.h +++ b/Source/Fractorium/SpinBox.h @@ -23,10 +23,15 @@ public: void SetValueStealth(size_t d); void DoubleClick(bool b); void DoubleClickLowVal(int val); + int DoubleClickLowVal(); void DoubleClickZero(int val); + int DoubleClickZero(); void DoubleClickNonZero(int val); + int DoubleClickNonZero(); void SmallStep(int step); QLineEdit* lineEdit(); + std::function m_DoubleClickZeroEvent = [&](SpinBox*, int) {}; + std::function m_DoubleClickNonZeroEvent = [&](SpinBox*, int) {}; public slots: void onSpinBoxValueChanged(int i);