From 39ece00421f955e65c687c00dc6c89a68a4f48af Mon Sep 17 00:00:00 2001 From: vsv Date: Sat, 27 Dec 2014 11:04:29 +0300 Subject: [PATCH] Preserve selection on setDisplay mode --- src/XGUI/XGUI_Displayer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 8be3d0bca..9d3ce8fb8 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -614,12 +614,16 @@ void XGUI_Displayer::setDisplayMode(ObjectPtr theObject, DisplayMode theMode, bo Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl(); bool aCanBeShaded = ::canBeShaded(aAISIO); // In order to avoid extra closing/opening context - if (aCanBeShaded) + SelectMgr_IndexedMapOfOwner aSelectedOwners; + if (aCanBeShaded) { + myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners); closeLocalContexts(false); + } aContext->SetDisplayMode(aAISIO, theMode, toUpdate); if (aCanBeShaded) { openLocalContext(); activateObjects(myActiveSelectionModes); + myWorkshop->selector()->setSelectedOwners(aSelectedOwners); } } -- 2.39.2