Pcbnew: ensure footprint courtyard caches are rebuilt after rotation or flip

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19561
This commit is contained in:
jean-pierre charras 2025-01-09 17:59:05 +01:00
parent 7677c71fdb
commit 6c0e5508a9

View File

@ -2443,9 +2443,8 @@ void FOOTPRINT::Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
m_cachedHull.Mirror( m_pos, aFlipDirection );
// Re-use cached geometry, just update the hashes. See SetPosition().
std::swap( m_courtyard_cache_front, m_courtyard_cache_back );
std::swap( m_courtyard_cache_back_hash, m_courtyard_cache_front_hash );
// The courtyard caches must be rebuilt after geometry change
BuildCourtyardCaches();
}
@ -2562,8 +2561,9 @@ void FOOTPRINT::SetOrientation( const EDA_ANGLE& aNewAngle )
m_boundingBoxCacheTimeStamp = 0;
m_textExcludedBBoxCacheTimeStamp = 0;
m_hullCacheTimeStamp = 0;
m_courtyard_cache_front_hash.Clear();
m_courtyard_cache_back_hash.Clear();
// The courtyard caches need to be rebuilt, as the geometry has changed
BuildCourtyardCaches();
}