fixed crashing polar charts on python3.10 #528 (#539)

pull/542/head v0.5.1
Holger Müller 2022-09-08 22:36:14 +02:00 zatwierdzone przez GitHub
rodzic 08635b0d4b
commit 37007a650d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
VERSION = "0.5.0"
VERSION = "0.5.1"
VERSION_URL = (
"https://raw.githubusercontent.com/"
"NanoVNA-Saver/nanovna-saver/master/NanoVNASaver/About.py")

Wyświetl plik

@ -27,12 +27,12 @@ logger = logging.getLogger(__name__)
class PolarChart(SquareChart):
def drawChart(self, qp: QtGui.QPainter):
center_x = int(self.width()/2)
center_y = int(self.height()/2)
width_2 = int(self.dim.width / 2)
height_2 = int(self.dim.height / 2)
width_45 = width_2 * 0.7071
height_45 = height_2 * 0.7071
center_x = self.width() // 2
center_y = self.height() // 2
width_2 = self.dim.width // 2
height_2 = self.dim.height // 2
width_45 = round(self.dim.width * 0.35355)
height_45 = round(self.dim.height * 0.35355)
qp.setPen(QtGui.QPen(Chart.color.text))
qp.drawText(3, 15, self.name)
@ -42,10 +42,10 @@ class PolarChart(SquareChart):
qp.drawEllipse(QtCore.QPoint(center_x, center_y),
width_2 // 2, height_2 // 2)
qp.drawLine(center_x - width_2, center_y, center_x + width_2, center_y)
qp.drawLine(center_x - width_2, center_y,
center_x + width_2, center_y)
qp.drawLine(center_x, center_y - height_2,
center_x, center_y + height_2)
qp.drawLine(center_x + width_45, center_y + height_45,
center_x - width_45, center_y - height_45)
qp.drawLine(center_x + width_45, center_y - height_45,