fix fill case

This commit is contained in:
Peter Hartmann 2022-01-14 15:38:08 +01:00
parent e4fc82cfd0
commit ee33711dd4
2 changed files with 15 additions and 8 deletions

View File

@ -557,10 +557,8 @@ int main( int argc, char* argv[] )
auto* tab5 = new QskLinearBox( Qt::Horizontal, 5 ); auto* tab5 = new QskLinearBox( Qt::Horizontal, 5 );
tab5->setMargins( 20 ); tab5->setMargins( 20 );
tab5->setSpacing( 20 ); tab5->setSpacing( 20 );
// addColoredBorderRectangles1( tab5, false ); // addColoredBorderRectangles1( tab5, true, Box::Unfilled );
// addColoredBorderRectangles1( tab5, true ); addColoredBorderRectangles1( tab5, true, Box::Horizontal );
addColoredBorderRectangles3( tab5, false );
addColoredBorderRectangles3( tab5, true );
window.addItem( tab5 ); window.addItem( tab5 );
#endif #endif

View File

@ -1001,6 +1001,7 @@ static inline void qskRenderBorder( const QskBoxRenderer::Metrics& metrics,
auto left = c.gradient( Qsk::Left ), top = c.gradient( Qsk::Top ), auto left = c.gradient( Qsk::Left ), top = c.gradient( Qsk::Top ),
right = c.gradient( Qsk::Right ), bottom = c.gradient( Qsk::Bottom ); 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, qskRenderBorderLines( metrics, orientation, line,
BorderMapGradient( stepCount, top.startColor().rgb(), left.endColor().rgb(), left ), BorderMapGradient( stepCount, top.startColor().rgb(), left.endColor().rgb(), left ),
BorderMapGradient( stepCount, right.startColor().rgb(), top.endColor().rgb(), top ), 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 int n = metrics.corner[ 0 ].stepCount;
const BorderMapGradient tl( n, bc.gradient( Qsk::Top ).startColor().rgb(), bc.gradient( Qsk::Left ).startColor().rgb() ); const BorderMapGradient tl( n, bc.gradient( Qsk::Top ).startColor().rgb(),
const BorderMapGradient tr( n, bc.gradient( Qsk::Right ).startColor().rgb(), bc.gradient( Qsk::Top ).startColor().rgb() ); bc.gradient( Qsk::Left ).endColor().rgb(),
const BorderMapGradient bl( n, bc.gradient( Qsk::Left ).startColor().rgb(), bc.gradient( Qsk::Bottom ).startColor().rgb() ); borderColors.gradient( Qsk::Left ) );
const BorderMapGradient br( n, bc.gradient( Qsk::Bottom ).startColor().rgb(), bc.gradient( Qsk::Right ).startColor().rgb() ); 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() ) if ( gradient.isMonochrome() )
{ {