From 6d40bf049e16e7e7b1d8ff70181a5ff3b2646be1 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 16 Jan 2025 16:02:40 -0800 Subject: [PATCH] Hold fp data constant We cache arc data to ensure that we know if it has changed since loading, however footprints perform transformation (displacement + rotation) on their internal elements, so we need to provide the same transformation to the cache in order to assure it matches when writing to disk, otherwise, the arc midpoint will be recalculated leading to instability Fixes https://gitlab.com/kicad/code/kicad/-/issues/19648 --- common/eda_shape.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 70645006e2..b4c956c140 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -539,6 +539,10 @@ void EDA_SHAPE::move( const VECTOR2I& aMoveVector ) { case SHAPE_T::ARC: m_arcCenter += aMoveVector; + m_arcMidData.center += aMoveVector; + m_arcMidData.start += aMoveVector; + m_arcMidData.end += aMoveVector; + m_arcMidData.mid += aMoveVector; KI_FALLTHROUGH; case SHAPE_T::SEGMENT: @@ -642,6 +646,10 @@ void EDA_SHAPE::rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) RotatePoint( m_start, aRotCentre, aAngle ); RotatePoint( m_end, aRotCentre, aAngle ); RotatePoint( m_arcCenter, aRotCentre, aAngle ); + RotatePoint( m_arcMidData.start, aRotCentre, aAngle ); + RotatePoint( m_arcMidData.end, aRotCentre, aAngle ); + RotatePoint( m_arcMidData.mid, aRotCentre, aAngle ); + RotatePoint( m_arcMidData.center, aRotCentre, aAngle ); break; case SHAPE_T::RECTANGLE: