From 492259a1d4fe9409ffa1031649f0cc61bbffcce5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 6 May 2022 18:13:10 +0100 Subject: [PATCH] Outline font bug fixes for PCBNew dimensions. Fixes https://gitlab.com/kicad/code/kicad/issues/11583 --- pcbnew/dialogs/dialog_dimension_properties.cpp | 7 +++++-- pcbnew/pcb_dimension.cpp | 2 +- pcbnew/pcb_painter.cpp | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pcbnew/dialogs/dialog_dimension_properties.cpp b/pcbnew/dialogs/dialog_dimension_properties.cpp index e34e1a9795..5583cf1342 100644 --- a/pcbnew/dialogs/dialog_dimension_properties.cpp +++ b/pcbnew/dialogs/dialog_dimension_properties.cpp @@ -69,8 +69,8 @@ DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES( PCB_BASE_EDIT_FRAME* a m_cbTextPositionMode->Hide(); break; - case PCB_DIM_CENTER_T: - case PCB_FP_DIM_CENTER_T: + case PCB_DIM_CENTER_T: + case PCB_FP_DIM_CENTER_T: m_sizerLeader->GetStaticBox()->Hide(); m_sizerFormat->GetStaticBox()->Hide(); m_sizerText->GetStaticBox()->Hide(); @@ -424,6 +424,9 @@ void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( PCB_DIMENSION_BASE* text.SetTextHeight( m_textHeight.GetValue() ); text.SetTextThickness( m_textThickness.GetValue() ); + if( m_fontCtrl->HaveFontSelection() ) + text.SetFont( m_fontCtrl->GetFontSelection( m_bold->IsChecked(), m_italic->IsChecked() ) ); + text.SetBold( m_bold->IsChecked() ); text.SetItalic( m_italic->IsChecked() ); diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index 3fab1181b0..1b2aba292b 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -643,7 +643,7 @@ void PCB_DIM_ALIGNED::updateGeometry() // Now that we have the text updated, we can determine how to draw the crossbar. // First we need to create an appropriate bounding polygon to collide with EDA_RECT textBox = m_text.GetTextBox().Inflate( m_text.GetTextWidth() / 2, - m_text.GetEffectiveTextPenWidth() ); + - m_text.GetEffectiveTextPenWidth() ); SHAPE_POLY_SET polyBox; polyBox.NewOutline(); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 7b24bb791f..44be218917 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -2120,9 +2120,10 @@ void PCB_PAINTER::draw( const ZONE* aZone, int aLayer ) void PCB_PAINTER::draw( const PCB_DIMENSION_BASE* aDimension, int aLayer ) { - const COLOR4D& strokeColor = m_pcbSettings.GetColor( aDimension, aLayer ); + const COLOR4D& color = m_pcbSettings.GetColor( aDimension, aLayer ); - m_gal->SetStrokeColor( strokeColor ); + m_gal->SetStrokeColor( color ); + m_gal->SetFillColor( color ); m_gal->SetIsFill( false ); m_gal->SetIsStroke( true );