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

View File

@ -1679,8 +1679,12 @@ const BOX2I PAD::ViewBBox() const
void PAD::ImportSettingsFrom( const PAD& aMasterPad ) void PAD::ImportSettingsFrom( const PAD& aMasterPad )
{ {
SetShape( aMasterPad.GetShape() ); SetShape( aMasterPad.GetShape() );
// Layer Set should be updated before calling SetAttribute()
SetLayerSet( aMasterPad.GetLayerSet() ); SetLayerSet( aMasterPad.GetLayerSet() );
SetAttribute( aMasterPad.GetAttribute() ); 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() ); SetProperty( aMasterPad.GetProperty() );
// Must be after setting attribute and layerSet // Must be after setting attribute and layerSet