Partial revert "Fix commit/view handling when dragging arcs"
Revert unintended formatting changes
This reverts commit f0988c3c5d
.
This commit is contained in:
parent
f0988c3c5d
commit
1cb1fd3516
|
@ -528,8 +528,7 @@ int EDIT_TOOL::DragArcTrack( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
if( theArc->GetAngle() + maxTangentDeviation >= ANGLE_180 )
|
if( theArc->GetAngle() + maxTangentDeviation >= ANGLE_180 )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format(
|
wxString msg = wxString::Format( _( "Unable to resize arc tracks of %s or greater." ),
|
||||||
_( "Unable to resize arc tracks of %s or greater." ),
|
|
||||||
EDA_UNIT_UTILS::UI::MessageTextFromValue( ANGLE_180 - maxTangentDeviation ) );
|
EDA_UNIT_UTILS::UI::MessageTextFromValue( ANGLE_180 - maxTangentDeviation ) );
|
||||||
frame()->ShowInfoBarError( msg );
|
frame()->ShowInfoBarError( msg );
|
||||||
|
|
||||||
|
@ -565,8 +564,8 @@ int EDIT_TOOL::DragArcTrack( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
std::set<PCB_TRACK*> addedTracks;
|
std::set<PCB_TRACK*> addedTracks;
|
||||||
|
|
||||||
auto getUniqueTrackAtAnchorCollinear = [&]( const VECTOR2I& aAnchor,
|
auto getUniqueTrackAtAnchorCollinear =
|
||||||
const SEG& aCollinearSeg ) -> PCB_TRACK*
|
[&]( const VECTOR2I& aAnchor, const SEG& aCollinearSeg ) -> PCB_TRACK*
|
||||||
{
|
{
|
||||||
std::shared_ptr<CONNECTIVITY_DATA> conn = board()->GetConnectivity();
|
std::shared_ptr<CONNECTIVITY_DATA> conn = board()->GetConnectivity();
|
||||||
|
|
||||||
|
@ -577,8 +576,9 @@ int EDIT_TOOL::DragArcTrack( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
for( int i = 0; i < 3; i++ )
|
for( int i = 0; i < 3; i++ )
|
||||||
{
|
{
|
||||||
itemsOnAnchor = conn->GetConnectedItemsAtAnchor(
|
itemsOnAnchor = conn->GetConnectedItemsAtAnchor( theArc, aAnchor,
|
||||||
theArc, aAnchor, { PCB_PAD_T, PCB_VIA_T, PCB_TRACE_T, PCB_ARC_T },
|
{ PCB_PAD_T, PCB_VIA_T,
|
||||||
|
PCB_TRACE_T, PCB_ARC_T },
|
||||||
allowedDeviation );
|
allowedDeviation );
|
||||||
allowedDeviation /= 2;
|
allowedDeviation /= 2;
|
||||||
|
|
||||||
|
@ -617,7 +617,7 @@ int EDIT_TOOL::DragArcTrack( const TOOL_EVENT& aEvent )
|
||||||
return track;
|
return track;
|
||||||
};
|
};
|
||||||
|
|
||||||
PCB_TRACK* trackOnStart = getUniqueTrackAtAnchorCollinear( theArc->GetStart(), tanStart );
|
PCB_TRACK* trackOnStart = getUniqueTrackAtAnchorCollinear( theArc->GetStart(), tanStart);
|
||||||
PCB_TRACK* trackOnEnd = getUniqueTrackAtAnchorCollinear( theArc->GetEnd(), tanEnd );
|
PCB_TRACK* trackOnEnd = getUniqueTrackAtAnchorCollinear( theArc->GetEnd(), tanEnd );
|
||||||
|
|
||||||
if( trackOnStart->GetLength() != 0 )
|
if( trackOnStart->GetLength() != 0 )
|
||||||
|
@ -636,7 +636,8 @@ int EDIT_TOOL::DragArcTrack( const TOOL_EVENT& aEvent )
|
||||||
if( tanIntersect = tanStart.IntersectLines( tanEnd ); !tanIntersect )
|
if( tanIntersect = tanStart.IntersectLines( tanEnd ); !tanIntersect )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
auto isTrackStartClosestToArcStart = [&]( PCB_TRACK* aTrack ) -> bool
|
auto isTrackStartClosestToArcStart =
|
||||||
|
[&]( PCB_TRACK* aTrack ) -> bool
|
||||||
{
|
{
|
||||||
double trackStartToArcStart = GetLineLength( aTrack->GetStart(), theArc->GetStart() );
|
double trackStartToArcStart = GetLineLength( aTrack->GetStart(), theArc->GetStart() );
|
||||||
double trackEndToArcStart = GetLineLength( aTrack->GetEnd(), theArc->GetStart() );
|
double trackEndToArcStart = GetLineLength( aTrack->GetEnd(), theArc->GetStart() );
|
||||||
|
@ -674,7 +675,8 @@ int EDIT_TOOL::DragArcTrack( const TOOL_EVENT& aEvent )
|
||||||
// * *
|
// * *
|
||||||
//
|
//
|
||||||
|
|
||||||
auto getFurthestPointToTanInterstect = [&]( VECTOR2I& aPointA, VECTOR2I& aPointB ) -> VECTOR2I
|
auto getFurthestPointToTanInterstect =
|
||||||
|
[&]( VECTOR2I& aPointA, VECTOR2I& aPointB ) -> VECTOR2I
|
||||||
{
|
{
|
||||||
if( ( aPointA - *tanIntersect ).EuclideanNorm()
|
if( ( aPointA - *tanIntersect ).EuclideanNorm()
|
||||||
> ( aPointB - *tanIntersect ).EuclideanNorm() )
|
> ( aPointB - *tanIntersect ).EuclideanNorm() )
|
||||||
|
|
Loading…
Reference in New Issue