Eeschema: Fix 2 minor compil warnings. Pcbnew, very minor fix: avoid using fixed scaling factor in code. Use internal units conversion instead.

This commit is contained in:
jean-pierre charras 2018-08-15 13:19:41 +02:00
parent 8db361882b
commit 8fd686e8f4
5 changed files with 12 additions and 6 deletions

View File

@ -575,7 +575,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName( const wxString& aName )
if( aName.IsEmpty() )
return false;
for( size_t i = 0; i < m_aliasListBox->GetCount(); ++i )
for( int i = 0; i < (int)m_aliasListBox->GetCount(); ++i )
{
if( i == m_aliasListBox->GetSelection() )
continue;

View File

@ -401,7 +401,7 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate()
m_libraryNameTextCtrl->SetValue( id.Format() );
// Check for missing field names.
for( size_t i = MANDATORY_FIELDS; i < (int) m_fields->size(); ++i )
for( size_t i = MANDATORY_FIELDS; i < m_fields->size(); ++i )
{
SCH_FIELD& field = m_fields->at( i );
wxString fieldName = field.GetName( false );

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License

View File

@ -73,6 +73,11 @@ public:
~MARKER_PCB();
/** A scaling factor to create the marker symbol
*/
static int MarkerScale() {return Millimeter2iu( 0.1 ); }
void Move(const wxPoint& aMoveVector) override
{
m_Pos += aMoveVector;
@ -107,7 +112,8 @@ public:
const BOX2I ViewBBox() const override
{
// The following is based on the PCB_PAINTER::draw( const MARKER_PCB* )
return BOX2I( m_Pos, VECTOR2I( 1300000, 1300000 ) );
// the value 13 comes from the max relative coordinate of the shape)
return BOX2I( m_Pos, VECTOR2I( 13*MarkerScale(), 13*MarkerScale() ) );
}
const EDA_RECT GetBoundingBox() const override;

View File

@ -1214,9 +1214,9 @@ void PCB_PAINTER::draw( const PCB_TARGET* aTarget )
void PCB_PAINTER::draw( const MARKER_PCB* aMarker )
{
// If you are changing this, update MARKER_PCB::ViewBBox()
const int scale = 100000;
const int scale = MARKER_PCB::MarkerScale();
// If you are changing this, update MARKER_PCB::ViewBBox()
const VECTOR2D arrow[] = {
VECTOR2D( 0 * scale, 0 * scale ),
VECTOR2D( 8 * scale, 1 * scale ),