From e21a0876b6b308df3e280f853a8f8df6f8de034a Mon Sep 17 00:00:00 2001 From: Scott Przybylski Date: Thu, 14 Aug 2014 00:59:07 -0700 Subject: [PATCH 1/2] GuiTreeView bug in buildVisibleTree There was a bug in buildVisibleTree, it should be setting the RebuildVisible flag, not clearing it. The clip rectangle did not appear to be updating when expanding items or calling scrollVisible, which expands all the items to make a particular item visible. This would cause part of the tree to be cut off. Setting the RebuildVisible flag made the problem go away. --- Engine/source/gui/controls/guiTreeViewCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index 7f36a5903..bbace92dc 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -1237,7 +1237,7 @@ void GuiTreeViewCtrl::buildVisibleTree(bool bForceFullUpdate) bForceFullUpdate = true; // Update the flags. - mFlags.clear(RebuildVisible); + mFlags.set(RebuildVisible); // build the root items Item *traverse = mRoot; From 2987681220c75a8fe1b21ddf5a3f0237a4665c20 Mon Sep 17 00:00:00 2001 From: Scott Przybylski Date: Thu, 14 Aug 2014 21:52:48 -0700 Subject: [PATCH 2/2] Alternate fix for GuiTreeView Adding `mFlags.set(RebuildVisible)` to `GuiTreeView::onWake()` fixes the problem where the tree is not drawn correctly when nodes are expanded in the TorqueScript `GuiTreeView::onWake()` callback function. --- Engine/source/gui/controls/guiTreeViewCtrl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index bbace92dc..191160372 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -1237,7 +1237,7 @@ void GuiTreeViewCtrl::buildVisibleTree(bool bForceFullUpdate) bForceFullUpdate = true; // Update the flags. - mFlags.set(RebuildVisible); + mFlags.clear(RebuildVisible); // build the root items Item *traverse = mRoot; @@ -1785,6 +1785,8 @@ bool GuiTreeViewCtrl::onWake() // make sure it's big enough for both bitmap AND font... mItemHeight = getMax((S32)mFont->getHeight(), (S32)mProfile->mBitmapArrayRects[0].extent.y); } + + mFlags.set(RebuildVisible); return true; }