fix borders for rect ellipses

This commit is contained in:
Peter Hartmann 2021-12-15 15:54:44 +01:00
parent 6e872bac99
commit 7a66d26887
1 changed files with 14 additions and 0 deletions

View File

@ -14,6 +14,8 @@
#include <qmath.h> #include <qmath.h>
#include <qsggeometry.h> #include <qsggeometry.h>
#include <QDebug> // ### remove
using namespace QskVertex; using namespace QskVertex;
namespace namespace
@ -1207,9 +1209,20 @@ void QskBoxRenderer::renderRectellipse( const QRectF& rect,
const int stepCount = metrics.corner[ 0 ].stepCount; const int stepCount = metrics.corner[ 0 ].stepCount;
int borderLineCount = 0; int borderLineCount = 0;
if ( borderColors.isVisible() && metrics.innerQuad != metrics.outerQuad ) if ( borderColors.isVisible() && metrics.innerQuad != metrics.outerQuad )
{
borderLineCount = 4 * ( stepCount + 1 ) + 1; borderLineCount = 4 * ( stepCount + 1 ) + 1;
const int additionalLines = -1
+ borderColors.gradient( Qsk::Left ).stops().count() - 1
+ borderColors.gradient( Qsk::Top ).stops().count() - 1
+ borderColors.gradient( Qsk::Right ).stops().count() - 1
+ borderColors.gradient( Qsk::Bottom ).stops().count() - 1;
borderLineCount += qMax( additionalLines, 0 );
}
int lineCount = borderLineCount + fillLineCount; int lineCount = borderLineCount + fillLineCount;
bool extraLine = false; bool extraLine = false;
@ -1286,6 +1299,7 @@ void QskBoxRenderer::renderRectellipse( const QRectF& rect,
borderLines++; borderLines++;
const auto orientation = qskQtOrientation( gradient ); const auto orientation = qskQtOrientation( gradient );
qDebug() << "border line count:" << borderLineCount;
qskRenderBorder( metrics, orientation, borderColors, borderLines ); qskRenderBorder( metrics, orientation, borderColors, borderLines );
if ( extraLine ) if ( extraLine )