From 5cf4e43b0edabcaa024be30cbf33c2ac8f3d3c46 Mon Sep 17 00:00:00 2001 From: Hannele Ruiz Date: Tue, 19 Dec 2023 01:56:08 -0300 Subject: [PATCH] Make sure that the framerate does not goes under zero --- LemonUI/Elements/ScaledAnim.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/LemonUI/Elements/ScaledAnim.cs b/LemonUI/Elements/ScaledAnim.cs index d8b7734..3a4a120 100644 --- a/LemonUI/Elements/ScaledAnim.cs +++ b/LemonUI/Elements/ScaledAnim.cs @@ -76,7 +76,15 @@ public string Dictionary public float FrameRate { get => frameRate; - set => frameRate = value; + set + { + if (frameRate <= 0) + { + throw new ArgumentOutOfRangeException(nameof(value), "The Frame Rate can't be equal or lower to zero."); + } + + frameRate = value; + } } /// /// The duration of the animation in milliseconds.