diff --git a/Data/Fractorium.spec b/Data/Fractorium.spec index a851750..bde296e 100644 --- a/Data/Fractorium.spec +++ b/Data/Fractorium.spec @@ -2,7 +2,7 @@ %define buildroot %{_topdir}/BUILDROOT Name: Fractorium -Version: 1.0.0.16 +Version: 1.0.0.17 Release: 1 Summary: A fractal flame editor with GPU support diff --git a/Data/Version History.txt b/Data/Version History.txt index 33fef95..7adfe65 100644 --- a/Data/Version History.txt +++ b/Data/Version History.txt @@ -1,3 +1,13 @@ +1.0.0.17 6/24/2019 +--User changes + -Add hex_modulus, inkdrop, Truchet_hex_crop and Truchet_hex_fill variations. + -Remove "Current" option for xform selection options. Now only Selected and All are available. If none are explicitly selected, it defaults to current being selected. + -Prevent mouse scrolling when panning the image with the middle mouse button down. + +--Bug fixes + -Prevent the minus key from changing the current xform when being pressed in a textbox or spinner. + -Fix xform selection logic to prevent selecting hidden pre and post xforms. + 1.0.0.16 6/03/2019 --User changes: -Allow changes which do not trigger a full render to be added to the undo list. diff --git a/Data/control.package b/Data/control.package index 5aae39f..4848a0e 100644 --- a/Data/control.package +++ b/Data/control.package @@ -8,7 +8,7 @@ Homepage: http://fractorium.com/ Vcs-Git: https://bitbucket.org/mfeemster/fractorium Vcs-Browser: https://bitbucket.org/mfeemster/fractorium Package: Fractorium -Version: 1.0.0.16 +Version: 1.0.0.17 Architecture: amd64 Description: A fractal flame editor with GPU support Fractorium diff --git a/README.md b/README.md index 4e1fc43..14b6f0c 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ of the cuburn algorithm in OpenCL. ## Windows -Download: [Fractorium_1.0.0.16.msi](https://drive.google.com/open?id=1FY43J-NbiaOIqgspGJDugFqVjan43xAl) +Download: [Fractorium_1.0.0.17.msi](https://drive.google.com/open?id=1xR7rPFcVvPMhh_n9v5JZ9-QUi7ktF7Qj) ## Mac -Download: [Fractorium_1.0.0.16.dmg](https://drive.google.com/open?id=1Jbwkg53ncjFaQhBYnRrXykyUDEao5mra) +Download: [Fractorium_1.0.0.17.dmg](https://drive.google.com/open?id=17UjkEBObj_rHRV8DCi1y3CDDONUZSxq_) ## Linux @@ -37,16 +37,16 @@ sudo apt-get install fractorium Install ubuntu. -Download: [Fractorium-1.0.0.16-.x86_64.deb](https://drive.google.com/open?id=14EJv5zKt6iohgTOT8J0AIyi8u1NIM_v5) +Download: [Fractorium-1.0.0.17.x86_64.deb](https://drive.google.com/open?id=1aYJ5XC58XPyFA-u-HuApLH4v9hFhf3oG) ``` cd ~/Downloads -sudo dpkg -i Fractorium-1.0.0.16-.x86_64.deb +sudo dpkg -i Fractorium-1.0.0.17.x86_64.deb ``` ### Install from App Image .rpm -Download: [Fractorium-1.0.0.16.x86_64.rpm](https://drive.google.com/open?id=1nzvIJ6gc7uAk6zubTPy4NIuMWCnCC2dx) +Download: [Fractorium-1.0.0.17.x86_64.rpm](https://drive.google.com/open?id=18LVDl5UYMGodvF1TjClGn-0HulgX6vhB) # Building from git diff --git a/Source/Ember/Variations01.h b/Source/Ember/Variations01.h index a7a8119..546664b 100644 --- a/Source/Ember/Variations01.h +++ b/Source/Ember/Variations01.h @@ -5026,7 +5026,7 @@ public: << "\t\treal_t t;\n" << "\t\treal_t pt = " << perturbation << " * sin(" << tpf2 << " * vIn.y);\n" << "\n" - << "\t\tif (!" << damping << ")\n" + << "\t\tif (" << damping << " == 0)\n" << "\t\t t = fma(" << amplitude << ", cos(fma(" << tpf << ", vIn.x, pt)), " << separation << ");\n" << "\t\telse\n" << "\t\t t = fma(" << amplitude << ", exp(-fabs(vIn.x) * " << damping << ") * cos(fma(" << tpf << ", vIn.x, pt)), " << separation << ");\n" diff --git a/Source/Ember/Variations04.h b/Source/Ember/Variations04.h index e0f2141..0d79095 100644 --- a/Source/Ember/Variations04.h +++ b/Source/Ember/Variations04.h @@ -2190,7 +2190,7 @@ public: helper.Out.x = m_Weight * xi + m_X; helper.Out.y = m_Weight * yi + m_Y; } - else if (!cr0 && esc) + else if (!cr0 && esc) { helper.Out.x = m_Weight * rdc * c + m_X; helper.Out.y = m_Weight * rdc * s + m_Y; @@ -2360,7 +2360,7 @@ public: << "\n" << "\t\tif (rad > " << out << " || rad < " << in << ")\n" << "\t\t{\n" - << "\t\t if (!" << zero << ")\n" + << "\t\t if (" << zero << " == 0)\n" << "\t\t {\n" << "\t\t s = sin(ang) * " << outweight << ";\n" << "\t\t c = cos(ang) * " << outweight << ";\n" diff --git a/Source/Ember/Variations07.h b/Source/Ember/Variations07.h index dafc4e2..1b7fae4 100644 --- a/Source/Ember/Variations07.h +++ b/Source/Ember/Variations07.h @@ -1581,7 +1581,7 @@ public: << "\n" << "\t\tbool add = true;\n" << "\n" - << "\t\tif (" << seed << " == 1)\n" + << "\t\tif (" << seed << " == (real_t)(1.0))\n" << "\t\t{\n" << "\t\t if (!((int)rx & 1) && !((int)rz & 1))\n" << "\t\t add = false;\n" @@ -1861,7 +1861,7 @@ public: << "\t\treal_t y0 = sin(angle2);\n" << "\t\treal_t dist = sqrt(Sqr(FX - x0) + Sqr(FY - y0));\n" << "\n" - << "\t\tif (" << inv << ")\n" + << "\t\tif (" << inv << " != (real_t)(0.0))\n" << "\t\t{\n" << "\t\t if ((dist > " << d1precalc << ") || (dist < " << d2precalc << "))\n" << "\t\t {\n" @@ -3007,11 +3007,12 @@ public: f = f - int_angle; T x = f * m_Length; T z = std::sqrt(1 + SQR(x) - 2 * x * m_CosAlpha); + int iangle = int(int_angle); - if (!(((int)int_angle) & 1)) - int_angle = m_2piOverPower * (((int)int_angle) / 2) + std::asin(m_SinAlpha * x / Zeps(z)); + if (!(iangle & 1)) + int_angle = m_2piOverPower * (iangle / 2) + std::asin(m_SinAlpha * x / Zeps(z)); else - int_angle = m_2piOverPower * (((int)int_angle) / 2) - std::asin(m_SinAlpha * x / Zeps(z)); + int_angle = m_2piOverPower * (iangle / 2) - std::asin(m_SinAlpha * x / Zeps(z)); z *= std::sqrt(rand.Frand01()); by = std::sin(int_angle - T(M_PI_2)); @@ -3056,11 +3057,12 @@ public: << "\t\t f = f - int_angle;\n" << "\t\t real_t x = f * " << length << ";\n" << "\t\t real_t z = sqrt(1 + SQR(x) - 2 * x * " << cosalpha << ");\n" + << "\t\t int iangle = (int)int_angle;\n" << "\n" - << "\t\t if (!(((int)int_angle) & 1))\n" - << "\t\t int_angle = " << twopioverpower << " * (((int)int_angle) / 2) + asin(" << sinalpha << " * x / Zeps(z));\n" + << "\t\t if (!(iangle & 1))\n" + << "\t\t int_angle = " << twopioverpower << " * (iangle / 2) + asin(" << sinalpha << " * x / Zeps(z));\n" << "\t\t else\n" - << "\t\t int_angle = " << twopioverpower << " * (((int)int_angle) / 2) - asin(" << sinalpha << " * x / Zeps(z));\n" + << "\t\t int_angle = " << twopioverpower << " * (iangle / 2) - asin(" << sinalpha << " * x / Zeps(z));\n" << "\n" << "\t\t z *= sqrt(MwcNext01(mwc));\n" << "\t\t by = sin(int_angle - MPI2);\n" @@ -3155,11 +3157,12 @@ public: f = f - int_angle; T x = f * m_Length; T z = std::sqrt(1 + SQR(x) - 2 * x * std::cos(m_Alpha)); + int iangle = int(int_angle); - if (!(((int)int_angle) & 1)) - int_angle = m_2piOverPower * (((int)int_angle) / 2) + std::asin(std::sin(m_Alpha) * x / Zeps(z)); + if (!(iangle & 1)) + int_angle = m_2piOverPower * (iangle / 2) + std::asin(std::sin(m_Alpha) * x / Zeps(z)); else - int_angle = m_2piOverPower * (((int)int_angle) / 2) - std::asin(std::sin(m_Alpha) * x / Zeps(z)); + int_angle = m_2piOverPower * (iangle / 2) - std::asin(std::sin(m_Alpha) * x / Zeps(z)); z *= std::sqrt(rand.Frand01()); by = std::sin(int_angle - T(M_PI_2)); @@ -3209,11 +3212,12 @@ public: << "\t\t f = f - int_angle;\n" << "\t\t real_t x = f * " << length << ";\n" << "\t\t real_t z = sqrt(1 + SQR(x) - 2 * x * cos(" << alpha << "));\n" + << "\t\t int iangle = (int)int_angle;\n" << "\n" - << "\t\t if (!(((int)int_angle) & 1))\n" - << "\t\t int_angle = " << twopioverpower << " * (((int)int_angle) / 2) + asin(sin(" << alpha << ") * x / Zeps(z));\n" + << "\t\t if (!(iangle & 1))\n" + << "\t\t int_angle = " << twopioverpower << " * (iangle / 2) + asin(sin(" << alpha << ") * x / Zeps(z));\n" << "\t\t else\n" - << "\t\t int_angle = " << twopioverpower << " * (((int)int_angle) / 2) - asin(sin(" << alpha << ") * x / Zeps(z));\n" + << "\t\t int_angle = " << twopioverpower << " * (iangle / 2) - asin(sin(" << alpha << ") * x / Zeps(z));\n" << "\n" << "\t\t z *= sqrt(MwcNext01(mwc));\n" << "\t\t by = sin(int_angle - MPI2);\n" diff --git a/Source/EmberCommon/EmberCommon.h b/Source/EmberCommon/EmberCommon.h index 2eb6c1d..5673dc7 100644 --- a/Source/EmberCommon/EmberCommon.h +++ b/Source/EmberCommon/EmberCommon.h @@ -736,6 +736,38 @@ bool SearchVar(const Variation* var, const vector& stringVec, bool ma return ret; } +template +bool SearchVarWWO(const Variation* var, const vector& withVec, const vector& withoutVec) +{ + bool ret = false; + size_t i, j, k; + bool onegood = false; + auto cl = var->OpenCLFuncsString() + "\n" + var->OpenCLString(); + vector clsplits = Split(cl, '\n'); + + for (i = 0; i < clsplits.size(); i++) + { + for (j = 0; j < withVec.size(); j++) + { + if (clsplits[i].find(withVec[j]) != std::string::npos) + { + for (k = 0; k < withoutVec.size(); k++) + { + if (clsplits[i].find(withoutVec[k]) != std::string::npos) + { + return false; + } + } + + onegood = true; + } + } + } + + return onegood; + //return i == clsplits.size() && j == withVec.size() && k == withoutVec.size(); +} + /// /// Find all variations whose OpenCL string contains any of the search strings in stringVec. /// This is useful for finding variations with certain characteristics since it's not possible @@ -766,6 +798,23 @@ static vector*> FindVarsWith(const vector* return vec; } +template +static vector*> FindVarsWithWithout(const vector*>& vars, const vector& withVec, const vector& withoutVec) +{ + vector*> vec; + auto vl = VariationList::Instance(); + + for (auto& v : vars) + { + if (SearchVarWWO(v, withVec, withoutVec)) + { + vec.push_back(v); + } + } + + return vec; +} + /// /// Find all variations whose OpenCL string does not contain any of the search strings in stringVec. /// This is useful for finding variations without certain characteristics since it's not possible diff --git a/Source/EmberTester/EmberTester.cpp b/Source/EmberTester/EmberTester.cpp index d60203a..9a66dbc 100644 --- a/Source/EmberTester/EmberTester.cpp +++ b/Source/EmberTester/EmberTester.cpp @@ -1585,21 +1585,26 @@ void TestOperations() void TestArbitrary() { - vector stringVec; + vector stringVec, withoutVec; auto varList = VariationList::Instance(); auto& vars = varList->AllVars(); - stringVec.push_back(" = vIn.x - "); - stringVec.push_back(" = vIn.y - "); - stringVec.push_back("sqrt("); - stringVec.push_back("atan2("); - stringVec.push_back("sin("); - stringVec.push_back("cos("); + stringVec.push_back("if (!"); + withoutVec.push_back("="); + withoutVec.push_back("<"); + withoutVec.push_back(">"); + //stringVec.push_back(" = vIn.x - "); + //stringVec.push_back(" = vIn.y - "); + //stringVec.push_back("sqrt("); + //stringVec.push_back("atan2("); + //stringVec.push_back("sin("); + //stringVec.push_back("cos("); //stringVec.push_back("sincos("); - auto varVec = FindVarsWith(vars, stringVec, true, true); + //auto varVec = FindVarsWith(vars, stringVec, true, true); + auto varVec = FindVarsWithWithout(vars, stringVec, withoutVec); for (auto& it : varVec) { - cout << "Variation " << it->Name() << " contained the desired strings." << endl; + cout << "Variation " << it->Name() << " contained the desired w/wo strings." << endl; } } diff --git a/Source/Fractorium/Fractorium.cpp b/Source/Fractorium/Fractorium.cpp index ebf0c73..4d860da 100644 --- a/Source/Fractorium/Fractorium.cpp +++ b/Source/Fractorium/Fractorium.cpp @@ -404,10 +404,11 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e) } else if (o == this) { + auto focusedctrlEdit = dynamic_cast(this->focusWidget()); auto focusedctrlSpin = dynamic_cast(this->focusWidget()); - auto focusedctrlDbSpin = dynamic_cast(this->focusWidget()); + auto focusedctrlDblSpin = dynamic_cast(this->focusWidget()); - if (!focusedctrlSpin && !focusedctrlDbSpin)//Must exclude these because otherwise, typing a minus key in any of the spinners will switch the xform. + if (!focusedctrlEdit && !focusedctrlSpin && !focusedctrlDblSpin)//Must exclude these because otherwise, typing a minus key in any of the spinners will switch the xform. { unsigned int index = combo->currentIndex(); diff --git a/debian/changelog b/debian/changelog index 4291f08..59432a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +fractorium (1.0.0.17-0ubuntu1) bionic; urgency=low + + * release 1.0.0.17 + + -- Matt Feemster Mon, 24 Jun 2019 20:30:00 -0700 + fractorium (1.0.0.16-0ubuntu1) bionic; urgency=low * release 1.0.0.16