Browse Source

Switch preview items to use abstract render settings

pull/15/head
Ian McInerney 6 years ago
committed by Wayne Stambaugh
parent
commit
e675a93b92
  1. 1
      common/preview_items/arc_assistant.cpp
  2. 4
      common/preview_items/polygon_item.cpp
  3. 4
      common/preview_items/preview_utils.cpp
  4. 6
      common/preview_items/ruler_item.cpp
  5. 2
      common/preview_items/selection_area.cpp

1
common/preview_items/arc_assistant.cpp

@ -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>

4
common/preview_items/polygon_item.cpp

@ -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 );

4
common/preview_items/preview_utils.cpp

@ -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;

6
common/preview_items/ruler_item.cpp

@ -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();

2
common/preview_items/selection_area.cpp

@ -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;

Loading…
Cancel
Save