std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aCompSolid);
if (aShapePtr.get()) {
TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
- int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_SHAPE);
+ int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_COMPSOLID);
+ /// It is important to have priority for the shape of comp solid result less than priority
+ /// for the presentation shape which is a sub-result. Reason is to select the sub-objects before: #1592
+ aPriority = aPriority - 1;
double aDeflection = Prs3d::GetDeflection(aShape, myDrawer);
Handle(ModuleBase_BRepOwner) aOwner = new ModuleBase_BRepOwner(aShape, aPriority);