mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-05-23 22:36:16 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
namespace Editor.MovieMaker;
|
|
|
|
#nullable enable
|
|
|
|
partial class Session
|
|
{
|
|
private TrackListView? _trackList;
|
|
private float _trackListScrollPosition;
|
|
|
|
/// <summary>
|
|
/// Which tracks should be visible in the track list / dope sheet.
|
|
/// </summary>
|
|
public TrackListView TrackList => _trackList ??= new TrackListView( this );
|
|
|
|
public float TrackListScrollOffset => 32f;
|
|
|
|
public float TrackListScrollPosition
|
|
{
|
|
get
|
|
{
|
|
var viewHeight = TrackListViewHeight;
|
|
var contentsHeight = TrackList.Height;
|
|
var headerOffset = -TrackListHeaderHeight + 28f;
|
|
|
|
var max = Math.Max( headerOffset, contentsHeight - viewHeight );
|
|
|
|
return Math.Clamp( _trackListScrollPosition, headerOffset, max );
|
|
}
|
|
set
|
|
{
|
|
if ( _trackListScrollPosition.Equals( value ) ) return;
|
|
|
|
_trackListScrollPosition = value;
|
|
Cookies.ScrollPosition = value;
|
|
|
|
DispatchViewChanged();
|
|
}
|
|
}
|
|
|
|
public float TrackListHeaderHeight { get; set; } = 0f;
|
|
public float TrackListViewHeight { get; set; } = float.PositiveInfinity;
|
|
|
|
private void TrackFrame()
|
|
{
|
|
_trackList?.Frame();
|
|
}
|
|
}
|