Decide a timeline row's visibility in one place

This commit is contained in:
shweet committed 2026-11-22 19:12:59 -05:00
1 parent f78d35b12b
commit c467c39baa
4 files changed
+12 -12

No files matched your search

+1
View File
@@ -227,6 +227,7 @@ struct TimelineContext : TimelineState
void frame_split();
std::vector<TimelineRow> timeline_item_rows_get();
bool is_row_selected(const TimelineRow& row);
bool is_row_visible(const TimelineRow&, const Track*);
void row_selection_clear();
void row_selection_insert(const TimelineRow& row);
bool is_row_reference_selected(const TimelineRow& row);
+1 -6
View File
@@ -97,12 +97,7 @@ void TimelineContext::frame_child(const TimelineRow& row, int& index, float widt
if (type != NONE && !item)
return;
auto isVisible = item ? item->isVisible && is_track_group_visible(type, row.groupId) : false;
if (item && type == ROOT && row.groupId != -1)
isVisible = item->isVisible && is_track_group_visible(row.groupType, row.groupId);
auto& isOnlyShowLayers = settings.timelineIsOnlyShowLayers;
if (isOnlyShowLayers && type != LAYER)
isVisible = false;
auto isVisible = is_row_visible(row, item);
auto colorVec = color_get(COLOR_FRAME_BASE, type);
auto colorActiveVec = color_get(COLOR_FRAME_ACTIVE, type);
+9
View File
@@ -331,3 +331,12 @@ std::vector<TimelineRow> TimelineContext::row_drag_references_get(const Timeline
rows = {clicked};
return rows;
}
// Whether a row's track shows: it and its group are visible, and only layers show when asked.
bool TimelineContext::is_row_visible(const TimelineRow& row, const Track* item)
{
if (!item || (settings.timelineIsOnlyShowLayers && row.type != LAYER))
return false;
auto groupType = row.type == ROOT && row.groupId != -1 ? row.groupType : row.type;
return item->isVisible && is_track_group_visible(groupType, row.groupId);
}
+1 -6
View File
@@ -132,12 +132,7 @@ void TimelineContext::item_child(const TimelineRow& row, int index)
return;
}
auto isItemVisible = item ? item->isVisible : false;
auto isVisible = item ? item->isVisible && is_track_group_visible(type, row.groupId) : false;
if (item && type == ROOT && row.groupId != -1)
isVisible = item->isVisible && is_track_group_visible(row.groupType, row.groupId);
auto& isOnlyShowLayers = settings.timelineIsOnlyShowLayers;
if (isOnlyShowLayers && type != LAYER)
isVisible = false;
auto isVisible = is_row_visible(row, item);
auto isReferenced = is_same_item(reference, row_reference_make());
auto isItemSelected = is_row_selected(row);