Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve editor performance with many timeline ticks present #27632

Merged
merged 2 commits into from Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -7,6 +7,7 @@
using osu.Framework.Bindables;
using osu.Framework.Caching;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Logging;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
Expand All @@ -18,6 +19,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
public partial class TimelineTickDisplay : TimelinePart<PointVisualisation>
{
// With current implementation every tick in the sub-tree should be visible, no need to check whether they are masked away.
public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => false;

[Resolved]
private EditorBeatmap beatmap { get; set; } = null!;

Expand Down Expand Up @@ -165,7 +169,7 @@ private void createTicks()

// save a few drawables beyond the currently used for edge cases.
while (drawableIndex < Math.Min(usedDrawables + 16, Count))
Children[drawableIndex++].Hide();
Children[drawableIndex++].Alpha = 0;

// expire any excess
while (drawableIndex < Count)
Expand All @@ -182,7 +186,7 @@ Drawable getNextUsableLine()
point = Children[drawableIndex];

drawableIndex++;
point.Show();
point.Alpha = 1;

return point;
}
Expand Down