Don't modify radius when editing center.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17192
This commit is contained in:
Jeff Young 2024-05-05 19:48:14 +01:00
parent 5e14ae9698
commit 1290228fbf
2 changed files with 14 additions and 2 deletions

View File

@ -1990,13 +1990,13 @@ static struct EDA_SHAPE_DESC
.SetAvailableFunc( isNotPolygonOrCircle );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Center X" ),
&EDA_SHAPE::SetStartX, &EDA_SHAPE::GetStartX, PROPERTY_DISPLAY::PT_COORD,
&EDA_SHAPE::SetCenterX, &EDA_SHAPE::GetStartX, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_X_COORD ),
shapeProps )
.SetAvailableFunc( isCircle );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Center Y" ),
&EDA_SHAPE::SetStartY, &EDA_SHAPE::GetStartY, PROPERTY_DISPLAY::PT_COORD,
&EDA_SHAPE::SetCenterY, &EDA_SHAPE::GetStartY, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_Y_COORD ),
shapeProps )
.SetAvailableFunc( isCircle );

View File

@ -144,6 +144,18 @@ public:
m_endsSwapped = false;
}
void SetCenterY( int y )
{
m_end.y += y - m_start.y;
m_start.y = y;
}
void SetCenterX( int x )
{
m_end.x += x - m_start.x;
m_start.x = x;
}
/**
* Return the ending point of the graphic.
*/