]> OCCT Git - occt-copy.git/commitdiff
0030726: Visualization - change Selected state of owner in AIS_Selection
authornds <nds@opencascade.com>
Wed, 22 May 2019 11:24:12 +0000 (14:24 +0300)
committernds <nds@opencascade.com>
Wed, 22 May 2019 11:25:40 +0000 (14:25 +0300)
# IsHilighted by owner should use the same logic like when it is highlighted. IsSelected is used for selection state, not highlight.
#
# Without this correction, object is never shown as selected by click (Select(bool)):
# if (!HighlightStyle (theOwner, aCustomStyle) ||
#    (!aCustomStyle.IsNull() && aCustomStyle != anObjSelStyle))
# IsSelected is already true, so the highlight style is equal to selection style, nothing to do.

(cherry picked from commit 7d778441498ef0f0f545c800c671ee693bb5cf05)

src/AIS/AIS_InteractiveContext.cxx

index 5c8aa1368cd7f5af93c6e78fd719f13abcd4d515..572979090b2999372f0261f6e447141b75685584 100644 (file)
@@ -756,7 +756,9 @@ Standard_Boolean AIS_InteractiveContext::IsHilighted (const Handle(SelectMgr_Ent
     return myObjects (anObj)->IsHilighted();
   }
 
-  return theOwner->IsSelected();
+  const Handle(Prs3d_Drawer)& aStyle = getSelStyle (anObj, theOwner);
+  const Standard_Integer aHiMode = getHilightMode (anObj, aStyle, -1);
+  return theOwner->IsHilighted (myMainPM, aHiMode);
 }
 
 //=======================================================================