Use background color for checkerboard when not UNSPECIFIED.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16961
This commit is contained in:
parent
c92728715d
commit
f75c72ebb5
|
@ -65,17 +65,35 @@ void COLOR_SWATCH::RenderToDC( wxDC* aDC, const KIGFX::COLOR4D& aColor,
|
||||||
COLOR4D black;
|
COLOR4D black;
|
||||||
bool rowCycle;
|
bool rowCycle;
|
||||||
|
|
||||||
if( aCheckerboardBackground.GetBrightness() > 0.4 )
|
if( aColor == COLOR4D::UNSPECIFIED )
|
||||||
{
|
{
|
||||||
white = COLOR4D::WHITE;
|
if( aCheckerboardBackground.GetBrightness() > 0.4 )
|
||||||
black = white.Darkened( 0.15 );
|
{
|
||||||
rowCycle = true;
|
white = COLOR4D::WHITE;
|
||||||
|
black = white.Darkened( 0.15 );
|
||||||
|
rowCycle = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
black = COLOR4D::BLACK;
|
||||||
|
white = black.Brightened( 0.15 );
|
||||||
|
rowCycle = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
black = COLOR4D::BLACK;
|
if( aBackground.GetBrightness() > 0.4 )
|
||||||
white = black.Brightened( 0.15 );
|
{
|
||||||
rowCycle = false;
|
white = aBackground;
|
||||||
|
black = white.Darkened( 0.15 );
|
||||||
|
rowCycle = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
black = COLOR4D::BLACK;
|
||||||
|
white = black.Brightened( 0.15 );
|
||||||
|
rowCycle = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int x = aRect.GetLeft(); x <= aRect.GetRight(); x += aCheckerboardSize.x )
|
for( int x = aRect.GetLeft(); x <= aRect.GetRight(); x += aCheckerboardSize.x )
|
||||||
|
|
Loading…
Reference in New Issue