Fix float precision issue when drawing curve or timeline time axes

#2455
This commit is contained in:
Wojtek Figat
2025-01-28 12:48:19 +01:00
parent 5ad323c7cb
commit 6a27e5338a
4 changed files with 32 additions and 31 deletions

View File

@@ -289,7 +289,7 @@ namespace FlaxEditor.GUI
/// <summary>
/// The curve time/value axes tick steps.
/// </summary>
protected float[] TickSteps = Utilities.Utils.CurveTickSteps;
protected double[] TickSteps = Utilities.Utils.CurveTickSteps;
/// <summary>
/// The curve contents area.
@@ -797,9 +797,9 @@ namespace FlaxEditor.GUI
private void DrawAxis(Float2 axis, Rectangle viewRect, float min, float max, float pixelRange)
{
Utilities.Utils.DrawCurveTicks((float tick, float strength) =>
Utilities.Utils.DrawCurveTicks((decimal tick, float strength) =>
{
var p = PointFromKeyframes(axis * tick, ref viewRect);
var p = PointFromKeyframes(axis * (float)tick, ref viewRect);
// Draw line
var lineRect = new Rectangle