Browse Source

Fix compil issues on Windows+msys2

Probably some fixes also on other platforms
7.0
jean-pierre charras 4 years ago
parent
commit
c4af66f6d3
  1. 1
      common/dialogs/dialog_hotkey_list.cpp
  2. 2
      common/font/font.cpp
  3. 14
      common/gal/cairo/cairo_print.cpp
  4. 11
      include/font/font.h
  5. 9
      qa/pns/pns_log_viewer.cpp

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

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

14
common/gal/cairo/cairo_print.cpp

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

11
include/font/font.h

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

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

Loading…
Cancel
Save