Skip to content

Commit 9b277d1

Browse files
fix: incorrect background position/wh when updated dynamically
1 parent 3ba4636 commit 9b277d1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/ui/animator.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#include <numbers>
66
#include <print>
77

8-
void ui::animated_float::update(float delta_t) {
8+
void ui::animated_float::update(float delta_time) {
99
if (easing == easing_type::mutation) {
10-
if (destination != value) {
10+
if (destination != value || progress != 1.f) {
1111
value = destination;
1212
if (after_animate)
1313
after_animate.value()(destination);
@@ -19,12 +19,12 @@ void ui::animated_float::update(float delta_t) {
1919
}
2020

2121
if (delay_timer < delay) {
22-
delay_timer += delta_t;
22+
delay_timer += delta_time;
2323
_updated = false;
2424
return;
2525
}
2626

27-
progress += delta_t / duration;
27+
progress += delta_time / duration;
2828

2929
if (progress < 0.f) {
3030
_updated = false;
@@ -83,7 +83,7 @@ void ui::animated_float::reset_to(float dest) {
8383
value = dest;
8484
this->from = dest;
8585
this->destination = dest;
86-
progress = 1.f;
86+
progress = 0.999999999f; // to avoid lerp issues
8787
delay_timer = 0.f;
8888
}
8989
void ui::animated_float::set_easing(easing_type easing) {

src/ui/extra_widgets.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ void acrylic_background_widget::update(update_context &ctx) {
126126

127127
rect_widget::update(ctx);
128128
dpi_scale = ctx.rt.dpi_scale;
129-
should_update = should_update || (width->updated() || height->updated() || radius->updated());
129+
should_update = should_update ||
130+
(width->updated() || height->updated() || radius->updated() ||
131+
x->updated() || y->updated() || opacity->updated());
130132
last_hwnd = nullptr;
131133
if (use_dwm) {
132134
radius->reset_to(8.f);

0 commit comments

Comments
 (0)