Fix compil issues on Windows+msys2

Probably some fixes also on other platforms
This commit is contained in:
jean-pierre charras 2022-01-02 18:27:43 +01:00
parent f32c1ab1d2
commit c4af66f6d3
5 changed files with 23 additions and 14 deletions

View File

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

View File

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

View File

@ -19,6 +19,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef __WXMSW__
#include <windows.h>
#include <gdiplus.h>
#include <cairo-win32.h>
#include <wx/msw/enhmeta.h>
#endif /* __WXMSW__ */
#include <gal/cairo/cairo_print.h>
#include <stdexcept>
@ -33,13 +40,6 @@ using std::max;
using std::min;
#endif
#ifdef __WXMSW__
#include <windows.h>
#include <gdiplus.h>
#include <cairo-win32.h>
#include <wx/msw/enhmeta.h>
#endif /* __WXMSW__ */
#ifdef __WXMAC__
#include <ApplicationServices/ApplicationServices.h>
#include <cairo-quartz.h>

View File

@ -35,7 +35,12 @@
#include <utf8.h>
#include <font/glyph.h>
#include <font/text_attributes.h>
#include <markup_parser.h>
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.

View File

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