From ef1952f34c4553712f7c3a299603d8525dccdd45 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Oct 2020 15:55:00 +0100 Subject: [PATCH] Fix providing floats to integer parameters In newer Python versions this results in a warning. Contributes to issue CURA-7501. --- cura/UI/CuraSplashScreen.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cura/UI/CuraSplashScreen.py b/cura/UI/CuraSplashScreen.py index 4074020865..d9caa207f4 100644 --- a/cura/UI/CuraSplashScreen.py +++ b/cura/UI/CuraSplashScreen.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import Qt, QCoreApplication, QTimer @@ -70,20 +70,20 @@ class CuraSplashScreen(QSplashScreen): font = QFont() # Using system-default font here font.setPixelSize(18) painter.setFont(font) - painter.drawText(60, 70 + self._version_y_offset, 330 * self._scale, 230 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[0]) + painter.drawText(60, 70 + self._version_y_offset, round(330 * self._scale), round(230 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[0]) if len(version) > 1: font.setPixelSize(16) painter.setFont(font) painter.setPen(QColor(200, 200, 200, 255)) - painter.drawText(247, 105 + self._version_y_offset, 330 * self._scale, 255 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[1]) + painter.drawText(247, 105 + self._version_y_offset, round(330 * self._scale), round(255 * self._scale), Qt.AlignLeft | Qt.AlignTop, version[1]) painter.setPen(QColor(255, 255, 255, 255)) # Draw the loading image pen = QPen() - pen.setWidth(6 * self._scale) + pen.setWidthF(6 * self._scale) pen.setColor(QColor(32, 166, 219, 255)) painter.setPen(pen) - painter.drawArc(60, 150, 32 * self._scale, 32 * self._scale, self._loading_image_rotation_angle * 16, 300 * 16) + painter.drawArc(60, 150, round(32 * self._scale), round(32 * self._scale), round(self._loading_image_rotation_angle * 16), 300 * 16) # Draw message text if self._current_message: