Commit b57450a5 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Make better default onion skins values (gaussian distribution)

Ref T1042
parent d86df01e
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#include <QColor> #include <QColor>
#include <QStandardPaths> #include <QStandardPaths>
#include "kis_global.h"
#include <cmath>
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
#include <errno.h> #include <errno.h>
#endif #endif
...@@ -227,7 +230,7 @@ void KisImageConfig::setSwapDir(const QString &swapDir) ...@@ -227,7 +230,7 @@ void KisImageConfig::setSwapDir(const QString &swapDir)
int KisImageConfig::numberOfOnionSkins() const int KisImageConfig::numberOfOnionSkins() const
{ {
return m_config.readEntry("numberOfOnionSkins", 1); return m_config.readEntry("numberOfOnionSkins", 10);
} }
void KisImageConfig::setNumberOfOnionSkins(int value) void KisImageConfig::setNumberOfOnionSkins(int value)
...@@ -247,7 +250,15 @@ void KisImageConfig::setOnionSkinTintFactor(int value) ...@@ -247,7 +250,15 @@ void KisImageConfig::setOnionSkinTintFactor(int value)
int KisImageConfig::onionSkinOpacity(int offset) const int KisImageConfig::onionSkinOpacity(int offset) const
{ {
return m_config.readEntry("onionSkinOpacity_" + QString::number(offset), 128); int value = m_config.readEntry("onionSkinOpacity_" + QString::number(offset), -1);
if (value < 0) {
const int num = numberOfOnionSkins();
const qreal dx = qreal(qAbs(offset)) / num;
value = 0.7 * exp(-pow2(dx) / 0.5) * 255;
}
return value;
} }
void KisImageConfig::setOnionSkinOpacity(int offset, int value) void KisImageConfig::setOnionSkinOpacity(int offset, int value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment