Formatting.

This commit is contained in:
Jeff Young 2022-06-01 23:55:59 +01:00
parent 40593930d0
commit f8829de5ea
1 changed files with 18 additions and 17 deletions

View File

@ -1216,14 +1216,11 @@ void PCB_POINT_EDITOR::updateItem() const
case SHAPE_T::BEZIER: case SHAPE_T::BEZIER:
if( isModified( m_editPoints->Point( BEZIER_CURVE_START ) ) ) if( isModified( m_editPoints->Point( BEZIER_CURVE_START ) ) )
shape->SetStart( m_editPoints->Point( BEZIER_CURVE_START ). shape->SetStart( m_editPoints->Point( BEZIER_CURVE_START ).GetPosition() );
GetPosition() );
else if( isModified( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT1 ) ) ) else if( isModified( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT1 ) ) )
shape->SetBezierC1( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT1 ). shape->SetBezierC1( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT1 ).GetPosition() );
GetPosition() );
else if( isModified( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT2 ) ) ) else if( isModified( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT2 ) ) )
shape->SetBezierC2( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT2 ). shape->SetBezierC2( m_editPoints->Point( BEZIER_CURVE_CONTROL_POINT2 ).GetPosition() );
GetPosition() );
else if( isModified( m_editPoints->Point( BEZIER_CURVE_END ) ) ) else if( isModified( m_editPoints->Point( BEZIER_CURVE_END ) ) )
shape->SetEnd( m_editPoints->Point( BEZIER_CURVE_END ).GetPosition() ); shape->SetEnd( m_editPoints->Point( BEZIER_CURVE_END ).GetPosition() );
@ -2119,12 +2116,12 @@ bool PCB_POINT_EDITOR::removeCornerCondition( const SELECTION& )
return false; return false;
} }
auto vertex = findVertex( *polyset, *m_editedPoint ); std::pair<bool, SHAPE_POLY_SET::VERTEX_INDEX> vertex = findVertex( *polyset, *m_editedPoint );
if( !vertex.first ) if( !vertex.first )
return false; return false;
const auto& vertexIdx = vertex.second; const SHAPE_POLY_SET::VERTEX_INDEX& vertexIdx = vertex.second;
// Check if there are enough vertices so one can be removed without // Check if there are enough vertices so one can be removed without
// degenerating the polygon. // degenerating the polygon.
@ -2132,7 +2129,9 @@ bool PCB_POINT_EDITOR::removeCornerCondition( const SELECTION& )
// there are only 2 vertices left, a hole is removed). // there are only 2 vertices left, a hole is removed).
if( vertexIdx.m_contour == 0 && if( vertexIdx.m_contour == 0 &&
polyset->Polygon( vertexIdx.m_polygon )[vertexIdx.m_contour].PointCount() <= 3 ) polyset->Polygon( vertexIdx.m_polygon )[vertexIdx.m_contour].PointCount() <= 3 )
{
return false; return false;
}
// Remove corner does not work with lines // Remove corner does not work with lines
if( dynamic_cast<EDIT_LINE*>( m_editedPoint ) ) if( dynamic_cast<EDIT_LINE*>( m_editedPoint ) )
@ -2174,7 +2173,9 @@ int PCB_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
zone->SetNeedRefill( true ); zone->SetNeedRefill( true );
} }
else else
{
zoneOutline = &( graphicItem->GetPolyShape() ); zoneOutline = &( graphicItem->GetPolyShape() );
}
commit.Modify( item ); commit.Modify( item );
@ -2210,8 +2211,8 @@ int PCB_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
} }
// Find the point on the closest segment // Find the point on the closest segment
auto& sideOrigin = zoneOutline->CVertex( nearestIdx ); const VECTOR2I& sideOrigin = zoneOutline->CVertex( nearestIdx );
auto& sideEnd = zoneOutline->CVertex( nextNearestIdx ); const VECTOR2I& sideEnd = zoneOutline->CVertex( nextNearestIdx );
SEG nearestSide( sideOrigin, sideEnd ); SEG nearestSide( sideOrigin, sideEnd );
VECTOR2I nearestPoint = nearestSide.NearestPoint( cursorPos ); VECTOR2I nearestPoint = nearestSide.NearestPoint( cursorPos );