From 27863c0bc9427408a2f738737e626c436adaf943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Sumi=C5=84ski?= Date: Wed, 6 Nov 2013 11:17:42 -0600 Subject: [PATCH] Patches one by Lorenzo, one by Orson --- common/view/view.cpp | 2 +- include/layers_id_colors_and_visibility.h | 1 - pcbnew/pcb_painter.cpp | 8 +++++++- pcbnew/pcbframe.cpp | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/view/view.cpp b/common/view/view.cpp index 8ecb887086..078fa0b907 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -645,7 +645,7 @@ void VIEW::draw( VIEW_ITEM* aItem, bool aImmediate ) const for( int i = 0; i < layers_count; ++i ) { - m_gal->SetLayerDepth( m_layers.at( i ).renderingOrder ); + m_gal->SetLayerDepth( m_layers.at( layers[i] ).renderingOrder ); draw( aItem, layers[i], aImmediate ); } } diff --git a/include/layers_id_colors_and_visibility.h b/include/layers_id_colors_and_visibility.h index 49b0b03508..d421e6cf4e 100644 --- a/include/layers_id_colors_and_visibility.h +++ b/include/layers_id_colors_and_visibility.h @@ -41,7 +41,6 @@ class BOARD; /* Layer identification (layer number) */ typedef int LAYER_NUM; #define UNDEFINED_LAYER -1 -#define NO_LAYER 0 #define FIRST_LAYER 0 #define FIRST_COPPER_LAYER 0 #define LAYER_N_BACK 0 diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 9e30b2ea94..692f73f5e7 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -670,13 +670,19 @@ void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment ) m_gal->SetFillColor( color ); m_gal->Save(); - m_gal->Translate( VECTOR2D( aSegment->GetPosition() ) ); MODULE* module = aSegment->GetParentModule(); if( module ) { + m_gal->Translate( module->GetPosition() ); m_gal->Rotate( -module->GetOrientation() * M_PI / 1800.0 ); } + else + { + // not tested + m_gal->Translate( aSegment->GetPosition() ); + m_gal->Rotate( -aSegment->GetAngle() * M_PI / 1800.0 ); + } std::copy( aSegment->GetPolyPoints().begin(), aSegment->GetPolyPoints().end(), std::back_inserter( pointsList ) ); diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 453ec2f0b7..473e0c736b 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -831,7 +831,7 @@ void PCB_EDIT_FRAME::setTopLayer( LAYER_NUM aLayer ) GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ), ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), - ITEM_GAL_LAYER( GP_OVERLAY ) + ITEM_GAL_LAYER( GP_OVERLAY ), DRAW_N }; for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i )