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

Obsolete CubicBezierEasing #13137

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
306 changes: 0 additions & 306 deletions src/Avalonia.Base/Animation/Easings/CubicBezier.cs

This file was deleted.

16 changes: 3 additions & 13 deletions src/Avalonia.Base/Animation/Easings/CubicBezierEasing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,16 @@

namespace Avalonia.Animation.Easings;

[Obsolete("Use SplineEasing instead")]
public sealed class CubicBezierEasing : IEasing
{
private CubicBezier _bezier;
//cubic-bezier(0.25, 0.1, 0.25, 1.0)
internal CubicBezierEasing(Point controlPoint1, Point controlPoint2)
private CubicBezierEasing()
{
ControlPoint1 = controlPoint1;
ControlPoint2 = controlPoint2;
if (controlPoint1.X < 0 || controlPoint1.X > 1 || controlPoint2.X < 0 || controlPoint2.X > 1)
throw new ArgumentException();
_bezier = new CubicBezier(controlPoint1.X, controlPoint1.Y, controlPoint2.X, controlPoint2.Y);
}

public Point ControlPoint2 { get; set; }
public Point ControlPoint1 { get; set; }

internal static IEasing Ease { get; } = new CubicBezierEasing(new Point(0.25, 0.1), new Point(0.25, 1));

double IEasing.Ease(double progress)
{
return _bezier.Solve(progress);
}
=> throw new NotSupportedException();
}
3 changes: 2 additions & 1 deletion src/Avalonia.Base/Rendering/Composition/Compositor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Avalonia.Animation;
using Avalonia.Animation.Easings;
using Avalonia.Media;
using Avalonia.Metadata;
Expand Down Expand Up @@ -85,7 +86,7 @@ internal Compositor(IRenderLoop loop, IPlatformGraphics? gpu,
_server = new ServerCompositor(loop, gpu, _batchObjectPool, _batchMemoryPool);
_triggerCommitRequested = () => scheduler.CommitRequested(this);

DefaultEasing = new CubicBezierEasing(new Point(0.25f, 0.1f), new Point(0.25f, 1f));
DefaultEasing = new SplineEasing(new KeySpline(0.25, 0.1, 0.25, 1.0));
}

/// <summary>
Expand Down