From b836f3cefa38504ae0c3310b08d1365232d8bb9f Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 24 Feb 2019 23:15:34 -0800 Subject: [PATCH] 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. --- pagelayout_editor/block.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pagelayout_editor/block.cpp b/pagelayout_editor/block.cpp index d0c34d2718..2226b53f37 100644 --- a/pagelayout_editor/block.cpp +++ b/pagelayout_editor/block.cpp @@ -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 ); + } } }