Skip to content

Commit 18787c0

Browse files
authored
Merge pull request #79 from stonebig/master
fix python-3.10+ reduced tolerance to implicit conversions
2 parents c06f7a0 + bdfefde commit 18787c0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/WASM_almar_klein_demo/rocket_qt.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import math
66

77
from qtpy import QtWidgets, QtCore, QtGui
8+
from qtpy.QtCore import QRectF # stonebig
89

910
from rocket import BaseRocketGame
1011

@@ -71,16 +72,21 @@ def wasm_clear_screen(self) -> None: # [] -> []
7172

7273
def wasm_draw_bullet(self, x: float, y: float) -> None: # [(0, 'f64'), (1, 'f64')] -> []
7374
self._painter.setBrush(QtGui.QColor('#0f0'))
74-
self._painter.drawEllipse(x, y, REL_SIZE*3, REL_SIZE*3)
75+
# self._painter.drawEllipse(x, y, REL_SIZE*3, REL_SIZE*3)
76+
rect = QRectF(x, y, REL_SIZE*3, REL_SIZE*3) # stonebig
77+
self._painter.drawEllipse(rect) # stonebig
7578

7679
def wasm_draw_enemy(self, x: float, y: float) -> None: # [(0, 'f64'), (1, 'f64')] -> []
7780
self._painter.setBrush(QtGui.QColor('#ff0'))
78-
self._painter.drawEllipse(x, y, REL_SIZE*14, REL_SIZE*14)
81+
# self._painter.drawEllipse(x, y, REL_SIZE*14, REL_SIZE*14) # stonebig
82+
rect = QRectF(x, y, REL_SIZE*14, REL_SIZE*14) # stonebig
83+
self._painter.drawEllipse(rect) # stonebig
7984

8085
def wasm_draw_particle(self, x: float, y: float, a: float) -> None: # [(0, 'f64'), (1, 'f64'), (2, 'f64')] -> []
8186
self._painter.setBrush(QtGui.QColor('#f04'))
82-
self._painter.drawEllipse(x, y, REL_SIZE, REL_SIZE)
83-
87+
# self._painter.drawEllipse(x, y, REL_SIZE, REL_SIZE) # stonebig
88+
rect = QRectF(x, y, REL_SIZE, REL_SIZE) # stonebig
89+
self._painter.drawEllipse(rect) # stonebig
8490
def wasm_draw_player(self, x: float, y: float, a: float) -> None: # [(0, 'f64'), (1, 'f64'), (2, 'f64')] -> []
8591
p = QtGui.QPainterPath()
8692
self._painter.save()

0 commit comments

Comments
 (0)