From 17f713cc1e576f43e00ce2085f65695cea08b568 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 27 May 2023 02:29:00 -0700 Subject: [PATCH] Fix animation stutter from repeated updates in `updateAnimations` --- src/TabGroup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 3f15389..1ba8629 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -116,14 +116,14 @@ void Hy3TabBar::updateAnimations(bool warp) { } auto warp_init = entry->offset.goalf() == -1.0; - entry->offset = offset; + if (entry->offset.goalf() != offset) entry->offset = offset; if (warp_init) { entry->offset.warp(); entry->width.setValueAndWarp(0.0); } - entry->width = entry_width; + if (entry->width.goalf() != entry_width) entry->width = entry_width; offset += entry_width; entry = std::next(entry);