From 1e3f15384eaeb00db24aba8ab23bb381bdfc0428 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 15 Sep 2015 18:22:18 +0200 Subject: [PATCH] Check top Objects first if current hover widget not descendant of topmost GraphicObject in topContainer.GraphicObjects --- src/OpenTKGameWindow.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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; -- 2.47.3