crash fixed for square rectangles with mutiple stops at 0.5

This commit is contained in:
Uwe Rathmann 2022-12-09 11:54:42 +01:00
parent b36521b0ed
commit 334254caf8
1 changed files with 6 additions and 16 deletions

View File

@ -114,12 +114,7 @@ namespace
{
const auto v = it.value();
if ( v == 0.5 )
{
// this line is also a contour line, so we can skip it
return;
}
else if ( v < 0.5 )
if ( v <= 0.5 )
{
const qreal dt = m_rect.width * 2 * v;
@ -559,16 +554,11 @@ void QskBoxRenderer::renderRect( const QRectF& rect,
if ( gradient.linearDirection().isTilted() )
{
if ( in.width == in.height )
{
if ( !gradient.hasStopAt( 0.5 ) )
fillLineCount++;
}
else
{
// we might need extra lines for the corners
fillLineCount += 2;
}
// extra lines for the corners
fillLineCount++;
if ( in.width != in.height )
fillLineCount++;
}
}