Skip to content

Commit 5cb6e30

Browse files
committed
Fix bitmap sprite placement now that larger Ys are at the to of the screen.
1 parent 6cfc121 commit 5cb6e30

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/aturtle/canvas.py

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ def create_polygon(self, coords, *, fill, outline, width):
3838
)
3939

4040

41+
def create_image(self, x, y, *, image, anchor):
42+
43+
return super().create_image(x, -y, image=image, anchor=anchor)
44+
45+
4146
def move(self, item_id, dx, dy):
4247

4348
return super().move(item_id, dx, -dy)

src/aturtle/sprites/bitmap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, canvas, shape, *, anchor=(0, 0), angle=0, speed=360,
2727
sprite_x - shape_x,
2828
sprite_y - shape_y,
2929
image=shape[angle],
30-
anchor='nw',
30+
anchor='sw',
3131
)
3232

3333

tests/test_bitmap_sprites.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_create_calls_canvas_create_image(self):
5656
-10,
5757
-10,
5858
image='image-at-angle-0',
59-
anchor='nw',
59+
anchor='sw',
6060
)
6161

6262

0 commit comments

Comments
 (0)