Browse Source

GUI Tooltip Timer Fix

This corrects issue #387 by reseting the tooltip timer when the mouse
leaves a mouse element.  This fix was suggested by ParodyGames on
Github.
Peter Robinson 8 years ago
parent
commit
8735dde800
1 changed files with 5 additions and 1 deletions
  1. 5 1
      engine/source/gui/guiCanvas.cc

+ 5 - 1
engine/source/gui/guiCanvas.cc

@@ -594,8 +594,12 @@ void GuiCanvas::findMouseControl(const GuiEvent &event)
    GuiControl *controlHit = findHitControl(event.mousePoint);
    GuiControl *controlHit = findHitControl(event.mousePoint);
    if(controlHit != static_cast<GuiControl*>(mMouseControl))
    if(controlHit != static_cast<GuiControl*>(mMouseControl))
    {
    {
-      if(bool(mMouseControl))
+      if (bool(mMouseControl))
+      {
          mMouseControl->onMouseLeave(event);
          mMouseControl->onMouseLeave(event);
+         hoverControlStart = Platform::getRealMilliseconds();
+         hoverPositionSet = false;
+      }
       mMouseControl = controlHit;
       mMouseControl = controlHit;
       mMouseControl->onMouseEnter(event);
       mMouseControl->onMouseEnter(event);
    }
    }