From 125c58dfda8472fc3b2974d286a9256f1e01e5f8 Mon Sep 17 00:00:00 2001 From: bitplane Date: Mon, 18 Jun 2007 04:15:12 +0000 Subject: [PATCH] fixed a bug in CGUIEnvironment::clear() reported by Jacky_J git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@718 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 3 ++- source/Irrlicht/CGUIEnvironment.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/changes.txt b/changes.txt index 8a6c608b..cf7202b0 100644 --- a/changes.txt +++ b/changes.txt @@ -159,7 +159,8 @@ GUI: - XML bitmap fonts now load textures from the XML file directory rather than the current one. - Fixed a small bug with click areas in combo boxes. - + + - Fixed a bug in clear() when an element was hovered or had focus GUI Editor: diff --git a/source/Irrlicht/CGUIEnvironment.cpp b/source/Irrlicht/CGUIEnvironment.cpp index 714b11b8..ecfd576e 100644 --- a/source/Irrlicht/CGUIEnvironment.cpp +++ b/source/Irrlicht/CGUIEnvironment.cpp @@ -272,6 +272,20 @@ IOSOperator* CGUIEnvironment::getOSOperator() //! clear all GUI elements void CGUIEnvironment::clear() { + + // Remove the focus + if (Focus) + { + Focus->drop(); + Focus = 0; + } + + if (Hovered && Hovered != this) + { + Hovered->drop(); + Hovered = 0; + } + // get the root's children in case the root changes in future const core::list& children = getRootGUIElement()->getChildren();