From c4af66f6d36bba2e0746b91b3c5a034c536ec536 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 2 Jan 2022 18:27:43 +0100 Subject: [PATCH] Fix compil issues on Windows+msys2 Probably some fixes also on other platforms --- common/dialogs/dialog_hotkey_list.cpp | 1 + common/font/font.cpp | 2 +- common/gal/cairo/cairo_print.cpp | 14 +++++++------- include/font/font.h | 11 ++++++++--- qa/pns/pns_log_viewer.cpp | 9 ++++++--- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/common/dialogs/dialog_hotkey_list.cpp b/common/dialogs/dialog_hotkey_list.cpp index d76cbfeeda..2f190fe971 100644 --- a/common/dialogs/dialog_hotkey_list.cpp +++ b/common/dialogs/dialog_hotkey_list.cpp @@ -48,6 +48,7 @@ DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS( EDA_BASE_FRAME* aParent ): main_sizer->Add( sdb_sizer, 0, wxEXPAND | wxALL, margin ); SetSizer( main_sizer ); + main_sizer->SetMinSize( 600, 400 ); finishDialogSettings(); } diff --git a/common/font/font.cpp b/common/font/font.cpp index 32f03f9771..2c11443ddc 100644 --- a/common/font/font.cpp +++ b/common/font/font.cpp @@ -264,7 +264,7 @@ VECTOR2D FONT::getBoundingBox( const UTF8& aText, TEXT_STYLE_FLAGS aTextStyle, } -void FONT::DrawText( KIGFX::GAL* aGal, const UTF8& aText, const VECTOR2D& aPosition, +void FONT::KiDrawText( KIGFX::GAL* aGal, const UTF8& aText, const VECTOR2D& aPosition, const TEXT_ATTRIBUTES& aAttributes ) const { // FONT TODO: do we need to set the attributes to the gal at all? diff --git a/common/gal/cairo/cairo_print.cpp b/common/gal/cairo/cairo_print.cpp index 76b6c569b2..3606806300 100644 --- a/common/gal/cairo/cairo_print.cpp +++ b/common/gal/cairo/cairo_print.cpp @@ -19,6 +19,13 @@ * with this program. If not, see . */ +#ifdef __WXMSW__ +#include +#include +#include +#include +#endif /* __WXMSW__ */ + #include #include @@ -33,13 +40,6 @@ using std::max; using std::min; #endif -#ifdef __WXMSW__ -#include -#include -#include -#include -#endif /* __WXMSW__ */ - #ifdef __WXMAC__ #include #include diff --git a/include/font/font.h b/include/font/font.h index 32976c0e9f..383230ef96 100644 --- a/include/font/font.h +++ b/include/font/font.h @@ -35,7 +35,12 @@ #include #include #include -#include + + +namespace MARKUP +{ +struct NODE; +} namespace KIGFX { @@ -132,8 +137,8 @@ public: return Draw( aGal, aText, aPosition, VECTOR2D( 0, 0 ), aAttributes ); } - virtual void DrawText( KIGFX::GAL* aGal, const UTF8& aText, const VECTOR2D& aPosition, - const TEXT_ATTRIBUTES& aAttributes ) const; + virtual void KiDrawText( KIGFX::GAL* aGal, const UTF8& aText, const VECTOR2D& aPosition, + const TEXT_ATTRIBUTES& aAttributes ) const; /** * Draw a string. diff --git a/qa/pns/pns_log_viewer.cpp b/qa/pns/pns_log_viewer.cpp index 9dd4ec5256..d25c9e4ede 100644 --- a/qa/pns/pns_log_viewer.cpp +++ b/qa/pns/pns_log_viewer.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2020-2021 KiCad Developers. + * Copyright (C) 2020-2022 KiCad Developers. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -67,8 +67,11 @@ void LABEL_MANAGER::Add( VECTOR2I target, std::string msg, COLOR4D color ) lbl.m_color = color; m_gal->SetGlyphSize( VECTOR2D( m_textSize, m_textSize ) ); - KIFONT::FONT* strokeFont = KIFONT::GetFont( wxEmptyString ); - VECTOR2I textDims = strokeFont->StringBoundaryLimits( m_gal, msg ); + KIFONT::FONT* strokeFont = KIFONT::FONT::GetFont( wxEmptyString ); + UTF8 text( msg ); + VECTOR2I textDims = strokeFont->StringBoundaryLimits( m_gal, text, + VECTOR2D( m_textSize, m_textSize ), + m_textSize/8 ); lbl.m_bbox.SetOrigin( lbl.m_target - textDims - VECTOR2I( m_textSize, m_textSize ) ); lbl.m_bbox.SetSize( textDims );