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:
Seth Hillbrand 2019-02-24 23:15:34 -08:00
parent 81a5bd977b
commit b836f3cefa
1 changed files with 15 additions and 1 deletions

View File

@ -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 );
}
}
}