Blob Blame History Raw
From 849f299ee97f0b2cd0bc81c9a01153f349c1d340 Mon Sep 17 00:00:00 2001
From: Davide Liessi <davide.liessi@gmail.com>
Date: Mon, 27 Dec 2021 12:45:29 +0100
Subject: [PATCH] fix another implicit float->int, not supported in Python 3.10

---
 frescobaldi_app/qutil.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/frescobaldi_app/qutil.py b/frescobaldi_app/qutil.py
index f7371f4d6..cd100cff2 100644
--- a/frescobaldi_app/qutil.py
+++ b/frescobaldi_app/qutil.py
@@ -182,9 +182,9 @@ def mixcolor(color1, color2, mix):
     """Returns a QColor as if color1 is painted on color2 with alpha value mix (0.0 - 1.0)."""
     r1, g1, b1 = color1.red(), color1.green(), color1.blue()
     r2, g2, b2 = color2.red(), color2.green(), color2.blue()
-    r = r1 * mix + r2 * (1 - mix)
-    g = g1 * mix + g2 * (1 - mix)
-    b = b1 * mix + b2 * (1 - mix)
+    r = int(r1 * mix + r2 * (1 - mix))
+    g = int(g1 * mix + g2 * (1 - mix))
+    b = int(b1 * mix + b2 * (1 - mix))
     return QColor(r, g, b)