Switch preview items to use abstract render settings

This commit is contained in:
Ian McInerney 2019-08-31 16:35:33 +02:00 committed by Wayne Stambaugh
parent 7a1ced7883
commit e675a93b92
5 changed files with 8 additions and 9 deletions

View File

@ -28,7 +28,6 @@
#include <gal/graphics_abstraction_layer.h>
#include <view/view.h>
#include <pcb_painter.h>
#include <common.h>
#include <base_units.h>

View File

@ -26,8 +26,8 @@
#include <preview_items/preview_utils.h>
#include <gal/graphics_abstraction_layer.h>
#include <painter.h>
#include <view/view.h>
#include <pcb_painter.h>
using namespace KIGFX::PREVIEW;
@ -58,7 +58,7 @@ void POLYGON_ITEM::SetPoints( const SHAPE_LINE_CHAIN& aLockedInPts,
void POLYGON_ITEM::drawPreviewShape( KIGFX::VIEW* aView ) const
{
auto& gal = *aView->GetGAL();
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
auto rs = aView->GetPainter()->GetSettings();
gal.DrawPolyline( m_lockedChain );
gal.DrawPolygon( m_polyfill );

View File

@ -20,7 +20,7 @@
#include <preview_items/preview_utils.h>
#include <gal/graphics_abstraction_layer.h>
#include <base_units.h>
#include <pcb_painter.h>
#include <painter.h>
#include <view/view.h>
double KIGFX::PREVIEW::PreviewOverlayDeemphAlpha( bool aDeemph )
@ -99,7 +99,7 @@ void KIGFX::PREVIEW::DrawTextNextToCursor( KIGFX::VIEW* aView,
{
auto gal = aView->GetGAL();
auto glyphSize = gal->GetGlyphSize();
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
auto rs = aView->GetPainter()->GetSettings();
const auto lineSpace = glyphSize.y * 0.2;
auto linePitch = glyphSize.y + lineSpace;

View File

@ -26,8 +26,8 @@
#include <preview_items/preview_utils.h>
#include <gal/graphics_abstraction_layer.h>
#include <layers_id_colors_and_visibility.h>
#include <painter.h>
#include <view/view.h>
#include <pcb_painter.h>
#include <base_units.h>
#include <common.h>
@ -122,7 +122,7 @@ void drawTicksAlongLine( KIGFX::VIEW *aView, const VECTOR2D& aOrigin,
auto gal = aView->GetGAL();
double tickSpace;
TICK_FORMAT tickF = getTickFormatForScale( gal->GetWorldScale(), tickSpace, aUnits );
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
auto rs = aView->GetPainter()->GetSettings();
// number of ticks in whole ruler
int numTicks = (int) std::ceil( aLine.EuclideanNorm() / tickSpace );
@ -226,7 +226,7 @@ void RULER_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
void RULER_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
{
auto& gal = *aView->GetGAL();
auto rs = static_cast<KIGFX::RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
auto rs = aView->GetPainter()->GetSettings();
VECTOR2D origin = m_geomMgr.GetOrigin();
VECTOR2D end = m_geomMgr.GetEnd();

View File

@ -25,8 +25,8 @@
#include <preview_items/selection_area.h>
#include <gal/graphics_abstraction_layer.h>
#include <painter.h>
#include <view/view.h>
#include <pcb_painter.h>
using namespace KIGFX::PREVIEW;