Commit 7b0d5683 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix a crash when using "shrink" deform brush

BUG:408887
parent b099a72d
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <kis_brush_size_option.h> #include <kis_brush_size_option.h>
#include <kis_deform_option.h> #include <kis_deform_option.h>
#include "kis_algebra_2d.h"
#include <time.h> #include <time.h>
...@@ -72,7 +73,7 @@ public: ...@@ -72,7 +73,7 @@ public:
return m_factor; return m_factor;
} }
void transform(qreal* x, qreal* y, qreal distance) override { void transform(qreal* x, qreal* y, qreal distance) override {
qreal scaleFactor = (1.0 - distance) * m_factor + distance; qreal scaleFactor = KisAlgebra2D::signPZ(m_factor) * (qAbs((1.0 - distance) * m_factor) + distance);
*x = *x / scaleFactor; *x = *x / scaleFactor;
*y = *y / scaleFactor; *y = *y / scaleFactor;
} }
......
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