Remove more special-casing for fp-edit commit handling
In the EDIT_TOOL::ModifyLines method, there was some remaining special-casing for FP childen commits. One bit was put back by mistake (in0b32ae3f4b
) because I thought I'd left it out of the refactor. In fact it was removed slightly later in1218f61d0a
. THe other bit is omitting Modify commits in the FP-editor (what the reinstatement of the above code was trying to cause). This shouldn't be needed any more. However, something is still incomplete here as the tools still don't work correctly in the footprint editor. However, I don't think it's substantially _more_ broken with the special casing removed and at least it's less confusing. Related to: https://gitlab.com/kicad/code/kicad/-/issues/15253
This commit is contained in:
parent
d1caadeb4f
commit
da0daffa89
|
@ -1197,10 +1197,6 @@ int EDIT_TOOL::ModifyLines( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
BOARD_COMMIT commit{ this };
|
BOARD_COMMIT commit{ this };
|
||||||
|
|
||||||
// Only modify one parent in FP editor
|
|
||||||
if( m_isFootprintEditor )
|
|
||||||
commit.Modify( selection.Front() );
|
|
||||||
|
|
||||||
// List of thing to select at the end of the operation
|
// List of thing to select at the end of the operation
|
||||||
// (doing it as we go will invalidate the iterator)
|
// (doing it as we go will invalidate the iterator)
|
||||||
std::vector<PCB_SHAPE*> items_to_select_on_success;
|
std::vector<PCB_SHAPE*> items_to_select_on_success;
|
||||||
|
@ -1210,14 +1206,11 @@ int EDIT_TOOL::ModifyLines( const TOOL_EVENT& aEvent )
|
||||||
// and whether the item was conjured up by decomposing a polygon or rectangle
|
// and whether the item was conjured up by decomposing a polygon or rectangle
|
||||||
const auto item_modification_handler = [&]( PCB_SHAPE& aItem )
|
const auto item_modification_handler = [&]( PCB_SHAPE& aItem )
|
||||||
{
|
{
|
||||||
if( !m_isFootprintEditor )
|
// If the item was "conjured up" it will be added later separately
|
||||||
|
if( !alg::contains( lines_to_add, &aItem ) )
|
||||||
{
|
{
|
||||||
// If the item was "conjured up" it will be added later separately
|
commit.Modify( &aItem );
|
||||||
if( !alg::contains( lines_to_add, &aItem ) )
|
items_to_select_on_success.push_back( &aItem );
|
||||||
{
|
|
||||||
commit.Modify( &aItem );
|
|
||||||
items_to_select_on_success.push_back( &aItem );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue