Don't draw PCB bitmaps on layers not visible in high-contrast mode.
This commit is contained in:
parent
71d0c7f6af
commit
e6cf5e5e01
|
@ -30,6 +30,7 @@
|
||||||
#include <pcb_draw_panel_gal.h>
|
#include <pcb_draw_panel_gal.h>
|
||||||
#include <plotters/plotter.h>
|
#include <plotters/plotter.h>
|
||||||
#include <settings/color_settings.h>
|
#include <settings/color_settings.h>
|
||||||
|
#include <pcb_painter.h>
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
@ -42,6 +43,9 @@
|
||||||
|
|
||||||
#include <wx/mstream.h>
|
#include <wx/mstream.h>
|
||||||
|
|
||||||
|
using KIGFX::PCB_PAINTER;
|
||||||
|
using KIGFX::PCB_RENDER_SETTINGS;
|
||||||
|
|
||||||
|
|
||||||
PCB_BITMAP::PCB_BITMAP( BOARD_ITEM* aParent, const VECTOR2I& pos, PCB_LAYER_ID aLayer ) :
|
PCB_BITMAP::PCB_BITMAP( BOARD_ITEM* aParent, const VECTOR2I& pos, PCB_LAYER_ID aLayer ) :
|
||||||
BOARD_ITEM( aParent, PCB_BITMAP_T, aLayer )
|
BOARD_ITEM( aParent, PCB_BITMAP_T, aLayer )
|
||||||
|
@ -134,11 +138,21 @@ double PCB_BITMAP::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||||
{
|
{
|
||||||
constexpr double HIDE = std::numeric_limits<double>::max();
|
constexpr double HIDE = std::numeric_limits<double>::max();
|
||||||
|
|
||||||
|
PCB_PAINTER* painter = static_cast<PCB_PAINTER*>( aView->GetPainter() );
|
||||||
|
PCB_RENDER_SETTINGS* renderSettings = painter->GetSettings();
|
||||||
|
|
||||||
// All bitmaps are drawn on LAYER_DRAW_BITMAPS, but their
|
// All bitmaps are drawn on LAYER_DRAW_BITMAPS, but their
|
||||||
// associated board layer controls their visibility.
|
// associated board layer controls their visibility.
|
||||||
if( !GetBoard()->IsLayerVisible( m_layer ) )
|
if( !GetBoard()->IsLayerVisible( m_layer ) )
|
||||||
return HIDE;
|
return HIDE;
|
||||||
|
|
||||||
|
if( renderSettings->GetHighContrast()
|
||||||
|
&& renderSettings->m_ContrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN
|
||||||
|
&& !renderSettings->GetLayerIsHighContrast( m_layer ) )
|
||||||
|
{
|
||||||
|
return HIDE;
|
||||||
|
}
|
||||||
|
|
||||||
return aView->IsLayerVisible( LAYER_DRAW_BITMAPS ) ? 0.0 : HIDE;
|
return aView->IsLayerVisible( LAYER_DRAW_BITMAPS ) ? 0.0 : HIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue