* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <cassert>
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const ViewItemOwner::item_list& TraceTreeItemOwner::child_items() const
{
pair<int, int> TraceTreeItemOwner::v_extents() const
{
- pair<int, int> extents(INT_MAX, INT_MIN);
+ bool has_children = false;
+ pair<int, int> extents(INT_MAX, INT_MIN);
for (const shared_ptr<TraceTreeItem> t : trace_tree_child_items()) {
assert(t);
if (!t->enabled())
continue;
+ has_children = true;
+
const int child_offset = t->layout_v_offset();
const pair<int, int> child_extents = t->v_extents();
extents.first = min(child_extents.first + child_offset,
extents.second);
}
+ if (!has_children)
+ extents = make_pair(0, 0);
+
return extents;
}
{
}
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv