We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed65a07 commit a19c75fCopy full SHA for a19c75f
stage.py
@@ -518,8 +518,16 @@ def tick(self):
518
def render_block(self, x0=0, y0=0, x1=None, y1=None):
519
if x1 is None:
520
x1 = self.width
521
+ else:
522
+ x1 = min(max(1, x1), self.width)
523
if y1 is None:
524
y1 = self.height
525
526
+ y1 = min(max(1, y1), self.height)
527
+ x0 = min(max(0, x0), self.width - 1)
528
+ y0 = min(max(0, y0), self.height - 1)
529
+ if x0 >= x1 or y0 >= y1:
530
+ return
531
layers = [l.layer for l in self.layers]
532
with self.display as display:
533
display.block(x0 * self.scale, y0 * self.scale,
@@ -539,7 +547,7 @@ def render_sprites(self, sprites):
539
547
max(sprite.px, int(sprite.x)) + 16))
540
548
y1 = max(1, min(self.height,
541
549
max(sprite.py, int(sprite.y)) + 16))
542
- if x0 == x1 or y0 == y1:
550
543
551
continue
544
552
545
553
x1 * self.scale - 1, y1 * self.scale - 1)
0 commit comments