From 55b2235d1860bcb5f903d42dfab6e9e5cf213bbf Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Mon, 18 Jul 2022 16:27:22 +0200 Subject: [PATCH] lineCount fixed ( clip nodes ended up with a final line with random coordinates ) --- src/nodes/QskBoxRendererEllipse.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/nodes/QskBoxRendererEllipse.cpp b/src/nodes/QskBoxRendererEllipse.cpp index 837f0127..808b640e 100644 --- a/src/nodes/QskBoxRendererEllipse.cpp +++ b/src/nodes/QskBoxRendererEllipse.cpp @@ -1315,9 +1315,18 @@ void QskBoxRenderer::renderRectellipseFill( const int stepCount = metrics.corner[ 0 ].stepCount; - int lineCount = 2 * ( stepCount + 1 ); + int lineCount = 2 * stepCount; + if ( metrics.centerQuad.top >= metrics.centerQuad.bottom ) + { + // we need an extra line connecting the top/bottom corners lineCount++; + } + else + { + // for some reason we have 2 more lines for true ellipses ?? + lineCount += 2; + } const auto line = allocateLines< Line >( geometry, lineCount ); qskRenderFillLines( metrics, Qt::Vertical, line, ColorMapNone() );