From ee33711dd4f0fec5e796c88b063d4c7f8b49141c Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 14 Jan 2022 15:38:08 +0100 Subject: [PATCH] fix fill case --- examples/boxes/main.cpp | 6 ++---- src/nodes/QskBoxRendererEllipse.cpp | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/examples/boxes/main.cpp b/examples/boxes/main.cpp index 89f0b52e..012c992b 100644 --- a/examples/boxes/main.cpp +++ b/examples/boxes/main.cpp @@ -557,10 +557,8 @@ int main( int argc, char* argv[] ) auto* tab5 = new QskLinearBox( Qt::Horizontal, 5 ); tab5->setMargins( 20 ); tab5->setSpacing( 20 ); -// addColoredBorderRectangles1( tab5, false ); -// addColoredBorderRectangles1( tab5, true ); - addColoredBorderRectangles3( tab5, false ); - addColoredBorderRectangles3( tab5, true ); +// addColoredBorderRectangles1( tab5, true, Box::Unfilled ); + addColoredBorderRectangles1( tab5, true, Box::Horizontal ); window.addItem( tab5 ); #endif diff --git a/src/nodes/QskBoxRendererEllipse.cpp b/src/nodes/QskBoxRendererEllipse.cpp index a73ec8c1..4f35cdb6 100644 --- a/src/nodes/QskBoxRendererEllipse.cpp +++ b/src/nodes/QskBoxRendererEllipse.cpp @@ -1001,6 +1001,7 @@ static inline void qskRenderBorder( const QskBoxRenderer::Metrics& metrics, auto left = c.gradient( Qsk::Left ), top = c.gradient( Qsk::Top ), right = c.gradient( Qsk::Right ), bottom = c.gradient( Qsk::Bottom ); + // ### I guess we could get rid of the 2 colors completely here? qskRenderBorderLines( metrics, orientation, line, BorderMapGradient( stepCount, top.startColor().rgb(), left.endColor().rgb(), left ), BorderMapGradient( stepCount, right.startColor().rgb(), top.endColor().rgb(), top ), @@ -1054,10 +1055,18 @@ static inline void qskRenderBoxRandom( { const int n = metrics.corner[ 0 ].stepCount; - const BorderMapGradient tl( n, bc.gradient( Qsk::Top ).startColor().rgb(), bc.gradient( Qsk::Left ).startColor().rgb() ); - const BorderMapGradient tr( n, bc.gradient( Qsk::Right ).startColor().rgb(), bc.gradient( Qsk::Top ).startColor().rgb() ); - const BorderMapGradient bl( n, bc.gradient( Qsk::Left ).startColor().rgb(), bc.gradient( Qsk::Bottom ).startColor().rgb() ); - const BorderMapGradient br( n, bc.gradient( Qsk::Bottom ).startColor().rgb(), bc.gradient( Qsk::Right ).startColor().rgb() ); + const BorderMapGradient tl( n, bc.gradient( Qsk::Top ).startColor().rgb(), + bc.gradient( Qsk::Left ).endColor().rgb(), + borderColors.gradient( Qsk::Left ) ); + const BorderMapGradient tr( n, bc.gradient( Qsk::Right ).startColor().rgb(), + bc.gradient( Qsk::Top ).endColor().rgb(), + borderColors.gradient( Qsk::Top ) ); + const BorderMapGradient bl( n, bc.gradient( Qsk::Left ).startColor().rgb(), + bc.gradient( Qsk::Bottom ).endColor().rgb(), + borderColors.gradient( Qsk::Bottom ) ); + const BorderMapGradient br( n, bc.gradient( Qsk::Bottom ).startColor().rgb(), + bc.gradient( Qsk::Right ).endColor().rgb(), + borderColors.gradient( Qsk::Right ) ); if ( gradient.isMonochrome() ) {