Commit 40d8fa30 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix a safe assert in RoundMarker brush

We shouldn't test for zeroness using qFuzzyCompare, instead we should
use some predefined epsilon value. This ensures we never try to divide
by an extremely small value, not representable by double precision
parent 739536ba
......@@ -393,7 +393,9 @@ QVector<QPointF> intersectTwoCircles(const QPointF &center1, qreal r1,
0.5 * (pow2(x_kp1) +
pow2(y_kp1) + pow2(r1) - pow2(r2));
if (qFuzzyCompare(diff.y(), 0)) {
const qreal eps = 1e-6;
if (qAbs(diff.y()) < eps) {
qreal x = F2 / diff.x();
qreal y1, y2;
int result = KisAlgebra2D::quadraticEquation(
......
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