···1515/// The frame index
1616frame: u4 = 0,
17171818+/// If the last time we handled a tick we were spinning. This is used to draw one time after we stop
1919+/// spinning
2020+was_spinning: bool = false,
2121+1822/// Start, or add one, to the spinner counter. Thread safe.
1923pub fn start(self: *Spinner) ?vxfw.Command {
2024 const count = self.count.fetchAdd(1, .monotonic);
···2226 return vxfw.Tick.in(time_lapse, self.widget());
2327 }
2428 return null;
2929+}
3030+3131+pub fn isSpinning(self: *Spinner) bool {
3232+ return self.count.load(.unordered) > 0;
2533}
26342735/// Reduce one from the spinner counter. The spinner will stop when it reaches 0. Thread safe
···4755 .tick => {
4856 const count = self.count.load(.unordered);
49575050- if (count == 0) return;
5858+ if (count == 0) {
5959+ if (self.was_spinning) {
6060+ ctx.redraw = true;
6161+ self.was_spinning = false;
6262+ }
6363+ return;
6464+ }
6565+ self.was_spinning = true;
5166 // Update frame
5267 self.frame += 1;
5368 if (self.frame >= frames.len) self.frame = 0;