Coverity fixes.
This commit is contained in:
parent
f5e99338a9
commit
fc22e602e2
|
@ -1060,7 +1060,7 @@ void PCB_TUNING_PATTERN::EditPush( GENERATOR_TOOL* aTool, BOARD* aBoard,
|
||||||
{
|
{
|
||||||
PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item );
|
PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item );
|
||||||
|
|
||||||
if( bounds.PointInside( track->GetPosition(), 2 )
|
if( track && bounds.PointInside( track->GetPosition(), 2 )
|
||||||
&& bounds.PointInside( track->GetEnd(), 2 ) )
|
&& bounds.PointInside( track->GetEnd(), 2 ) )
|
||||||
{
|
{
|
||||||
AddItem( item );
|
AddItem( item );
|
||||||
|
@ -1759,10 +1759,14 @@ int DRAWING_TOOL::PlaceTuningPattern( const TOOL_EVENT& aEvent )
|
||||||
int dummyClearance = std::numeric_limits<int>::max() / 2;
|
int dummyClearance = std::numeric_limits<int>::max() / 2;
|
||||||
VECTOR2I closestPt;
|
VECTOR2I closestPt;
|
||||||
|
|
||||||
m_pickerItem->GetEffectiveShape()->Collide( cursorPos, dummyClearance,
|
// With an artificially-large clearance this can't *not* collide, but the
|
||||||
&dummyDist, &closestPt );
|
// if stmt keeps Coverity happy....
|
||||||
|
if( m_pickerItem->GetEffectiveShape()->Collide( cursorPos, dummyClearance,
|
||||||
|
&dummyDist, &closestPt ) )
|
||||||
|
{
|
||||||
m_tuningPattern->SetPosition( closestPt );
|
m_tuningPattern->SetPosition( closestPt );
|
||||||
m_tuningPattern->SetEnd( closestPt );
|
m_tuningPattern->SetEnd( closestPt );
|
||||||
|
}
|
||||||
|
|
||||||
m_preview.Add( m_tuningPattern );
|
m_preview.Add( m_tuningPattern );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue