Page Layout: Do not double-move frames
When block selecting and dragging in Page Layout editor, multiple items with the same parent may be selected. We do not want to move them twice or the block will show with misaligned elements when placed.
This commit is contained in:
parent
81a5bd977b
commit
b836f3cefa
|
@ -226,12 +226,26 @@ void PL_EDITOR_FRAME::Block_Move( wxDC* DC )
|
|||
|
||||
// Move items in block
|
||||
SaveCopyInUndoList();
|
||||
|
||||
for( auto item: items )
|
||||
{
|
||||
auto parent = item->GetParent();
|
||||
|
||||
if( parent )
|
||||
parent->ClearFlags( FLAG1 );
|
||||
}
|
||||
|
||||
for( auto item: items )
|
||||
{
|
||||
if( item->HitTest( screen->m_BlockLocate ) )
|
||||
{
|
||||
auto data_item = item->GetParent();
|
||||
data_item->MoveToUi( data_item->GetStartPosUi() + delta );
|
||||
|
||||
if( data_item && !( data_item->GetFlags() & FLAG1 ) )
|
||||
{
|
||||
data_item->SetFlags( FLAG1 );
|
||||
data_item->MoveToUi( data_item->GetStartPosUi() + delta );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue