Coverity issue fixes.
Fix Coverity issues 338623, 338716, and 338717.
This commit is contained in:
parent
c816168e42
commit
4ee0b28ffc
|
@ -479,9 +479,6 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
if( item )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -785,7 +785,7 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
wxString netname = UnescapeString( aVia->GetShortNetname() );
|
||||
|
||||
// approximate the size of net name text:
|
||||
double tsize = 1.5 * size / PrintableCharCount( netname );
|
||||
double tsize = 1.5 * size / std::max( PrintableCharCount( netname ), 1 );
|
||||
tsize = std::min( tsize, size );
|
||||
|
||||
// Use a smaller text size to handle interline, pen size..
|
||||
|
@ -977,7 +977,7 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
netname = "*";
|
||||
|
||||
// approximate the size of net name text:
|
||||
double tsize = 1.5 * padsize.x / PrintableCharCount( netname );
|
||||
double tsize = 1.5 * padsize.x / std::max( PrintableCharCount( netname ), 1 );
|
||||
tsize = std::min( tsize, size );
|
||||
|
||||
// Use a smaller text size to handle interline, pen size...
|
||||
|
|
Loading…
Reference in New Issue