From: jpbruyere Date: Tue, 15 Sep 2015 16:22:18 +0000 (+0200) Subject: Check top Objects first if current hover widget not descendant of X-Git-Tag: 0.2~8 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=1e3f15384eaeb00db24aba8ab23bb381bdfc0428;p=jp%2Fcrow.git Check top Objects first if current hover widget not descendant of topmost GraphicObject in topContainer.GraphicObjects --- diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs index a50a05be..bc1ebda9 100755 --- a/src/OpenTKGameWindow.cs +++ b/src/OpenTKGameWindow.cs @@ -411,6 +411,27 @@ namespace go } if (_hoverWidget != null) { + //check topmost graphicobject first + GraphicObject tmp = _hoverWidget; + GraphicObject topc = null; + while (tmp is GraphicObject) { + topc = tmp; + tmp = tmp.Parent as GraphicObject; + } + int idxhw = GraphicObjects.IndexOf (topc); + if (idxhw != 0) { + int i = 0; + while (i < idxhw) { + if (GraphicObjects [i].MouseIsIn (e.Position)) { + _hoverWidget.onMouseLeave (this, e); + GraphicObjects [i].checkHoverWidget (e); + return; + } + i++; + } + } + + if (_hoverWidget.MouseIsIn (e.Position)) { _hoverWidget.checkHoverWidget (e); return;