TimelineEraLayout.h header

#include <ew/app/TimelineEraLayout.h>

Namespace ew::app

Functions

int ew::app::timelineEraRowCount(const std::vector< ew::core::TimelineEra > &eras)

The number of distinct rows timelineEraRows uses for eras – one more than the largest assigned row, or 0 when there are no eras. The paint uses this to reserve the era band's height.

std::vector< int > ew::app::timelineEraRows(const std::vector< ew::core::TimelineEra > &eras)

Assigns each era a stacking row so overlapping era bands never share a row – the labels then never collide (TL-18). Greedy interval packing: eras are considered earliest-start first and each is placed on the lowest row whose previous era has already ended (its effective end, so an end-before-start era is treated as zero-width and never blocks a row forever). The returned vector is parallel to eras (input order): rows[i] is era i's 0-based row. An empty input yields an empty result.