Commit 0a0b59fb authored by Boudewijn Rempt's avatar Boudewijn Rempt

BUG 414550: Fix an obviously wrong assert

Weirdly enough, this code has been here for 13 years, so I guess
it never got executed...

(cherry picked from commit 71ca2f24)
parent 3a3b9a2c
......@@ -234,8 +234,9 @@ bool KoSegmentGradient::saveToDevice(QIODevice *dev) const
KoGradientSegment *KoSegmentGradient::segmentAt(qreal t) const
{
Q_ASSERT(t >= 0 || t <= 1);
Q_ASSERT(!m_segments.empty());
if (t < 0.0) return 0;
if (t > 1.0) return 0;
if (m_segments.isEmpty()) return 0;
for (QList<KoGradientSegment *>::const_iterator it = m_segments.begin(); it != m_segments.end(); ++it) {
if (t > (*it)->startOffset() - DBL_EPSILON && t < (*it)->endOffset() + DBL_EPSILON) {
......
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