Skip to content

Commit

Permalink
When selecting a bookmark, skip over labels
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Jul 19, 2015
1 parent b593f74 commit 8df2e86
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions renderdocui/Windows/EventBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,30 @@ private bool FindEventNode(ref TreelistView.Node found, TreelistView.NodeCollect
return false;
}

private bool FindEventNode(ref TreelistView.Node found, UInt32 frameID, UInt32 eventID)
{
bool ret = FindEventNode(ref found, eventView.Nodes[0].Nodes, frameID, eventID);

while (found != null && found.NextSibling != null && found.NextSibling.Tag is DeferredEvent)
{
DeferredEvent def = found.NextSibling.Tag as DeferredEvent;

if (def.eventID == eventID)
found = found.NextSibling;
else
break;
}

return ret;
}

private bool SelectEvent(UInt32 frameID, UInt32 eventID)
{
if (eventView.Nodes.Count == 0) return false;

TreelistView.Node found = null;
FindEventNode(ref found, eventView.Nodes[0].Nodes, frameID, eventID);
FindEventNode(ref found, frameID, eventID);

if (found != null)
{
eventView.FocusedNode = found;
Expand Down Expand Up @@ -1053,17 +1071,7 @@ private void ToggleBookmark(UInt32 EID)
int index = m_Bookmark.IndexOf(EID);

TreelistView.Node found = null;
FindEventNode(ref found, eventView.Nodes[0].Nodes, m_Core.CurFrame, EID);

while (found.NextSibling != null && found.NextSibling.Tag is DeferredEvent)
{
DeferredEvent def = found.NextSibling.Tag as DeferredEvent;

if (def.eventID == EID)
found = found.NextSibling;
else
break;
}
FindEventNode(ref found, m_Core.CurFrame, EID);

if (index >= 0)
{
Expand Down

0 comments on commit 8df2e86

Please sign in to comment.