Skip to content

Commit 7015835

Browse files
committed
Fixed errors in _render.Image that the bunny pointed out.
1 parent 3ea9831 commit 7015835

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

buildconfig/stubs/pygame/_render.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class Image:
160160
origin: Optional[Iterable[float]]
161161
flip_x: bool
162162
flip_y: bool
163-
alpha: float
163+
alpha: int
164164
blend_mode: int
165165
texture: Texture
166166
srcrect: Rect

src_c/render.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,9 +1309,9 @@ image_renderer_draw(pgImageObject *self, PyObject *area, PyObject *dest)
13091309
return 0;
13101310
}
13111311
destrect.w =
1312-
(float)(areasrcptr ? areasrcptr->w : self->texture->width);
1312+
(float)(areasrcptr ? areasrcptr->w : self->srcrect->r.w);
13131313
destrect.h =
1314-
(float)(areasrcptr ? areasrcptr->h : self->texture->height);
1314+
(float)(areasrcptr ? areasrcptr->h : self->srcrect->r.h);
13151315
}
13161316
}
13171317

0 commit comments

Comments
 (0)