diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-15 18:22:18 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-15 18:22:18 +0200 |
| commit | 1e3f15384eaeb00db24aba8ab23bb381bdfc0428 (patch) | |
| tree | 1aec257c446785a2df60ef5a5efdb979b306ce2d /src/OpenTKGameWindow.cs | |
| parent | ff40620eabeaacb63d54aaa06c3a09bec49d1fca (diff) | |
Check top Objects first if current hover widget not descendant of
topmost GraphicObject in topContainer.GraphicObjects
Diffstat (limited to 'src/OpenTKGameWindow.cs')
| -rwxr-xr-x | src/OpenTKGameWindow.cs | 21 |
1 files changed, 21 insertions, 0 deletions
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;
|