From 1c88dbbf4052d691a17cf783e3c5231784c2e0e8 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 23 Nov 2024 13:16:47 +0100 Subject: [PATCH] voctogui.lib.toolbar.preview: only set_command() if sources change --- voctogui/lib/toolbar/preview.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/voctogui/lib/toolbar/preview.py b/voctogui/lib/toolbar/preview.py index 90616e42..23d7ff11 100644 --- a/voctogui/lib/toolbar/preview.py +++ b/voctogui/lib/toolbar/preview.py @@ -168,9 +168,10 @@ def set_command(self, command, do_test=True): def on_best(self, best, targetA, targetB): self.log.debug(f">on_best {best=} {targetA=} {targetB=}") c = self.command() - c.A = targetA - c.B = targetB - self.set_command(c, False) + if c.A != targetA or c.B != targetB: + c.A = targetA + c.B = targetB + self.set_command(c, False) self.update_glow() self.log.debug(f"