pad.cpp: fix possible incorrect layer mask in PAD::ImportSettingsFrom() after import

ImportSettingsFrom() calls SetAttribute() that can change the layer set.
This commit is contained in:
jean-pierre charras 2024-04-21 13:01:21 +02:00
parent 3fb521755b
commit 2d614898a8
1 changed files with 4 additions and 0 deletions

View File

@ -1679,8 +1679,12 @@ const BOX2I PAD::ViewBBox() const
void PAD::ImportSettingsFrom( const PAD& aMasterPad )
{
SetShape( aMasterPad.GetShape() );
// Layer Set should be updated before calling SetAttribute()
SetLayerSet( aMasterPad.GetLayerSet() );
SetAttribute( aMasterPad.GetAttribute() );
// Unfortunately, SetAttribute() can change m_layerMask.
// Be sure we keep the original mask by calling SetLayerSet() after SetAttribute()
SetLayerSet( aMasterPad.GetLayerSet() );
SetProperty( aMasterPad.GetProperty() );
// Must be after setting attribute and layerSet