From 55635b96240bc0bd95b705f3ebdf279f1e057e91 Mon Sep 17 00:00:00 2001 From: Hannele Ruiz Date: Tue, 19 Mar 2024 22:21:22 -0300 Subject: [PATCH] Moved texture updating to its own function --- LemonUI/Elements/ScaledAnim.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/LemonUI/Elements/ScaledAnim.cs b/LemonUI/Elements/ScaledAnim.cs index fd5bafb..8429ead 100644 --- a/LemonUI/Elements/ScaledAnim.cs +++ b/LemonUI/Elements/ScaledAnim.cs @@ -94,12 +94,9 @@ public ScaledAnim(string dict, PointF pos, SizeF size) : base(pos, size, dict, s #endregion - #region Functions + #region Tools - /// - /// Draws the animation. - /// - public override void Draw() + private void UpdateTexture() { if (Duration <= 0) { @@ -137,7 +134,18 @@ public override void Draw() } Texture = currentFrame.ToString(); + } + + #endregion + #region Functions + + /// + /// Draws the animation. + /// + public override void Draw() + { + UpdateTexture(); base.Draw(); }