Skip to content

Commit 2bb74ff

Browse files
committed
Fix bug in the pyframebuffer context API
1 parent ce64cf3 commit 2bb74ff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

native/paint.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ void __APISTATUS_internal pyfb_drawCircle(uint8_t fbnum,
165165
struct pyfb_videomode_info vinfo;
166166
pyfb_vinfo(fbnum, &vinfo);
167167

168-
const unsigned long int xres = vinfo.vinfo.xres;
169-
const unsigned long int yres = vinfo.vinfo.yres;
168+
const long int xres = ULI_TO_LI(vinfo.vinfo.xres);
169+
const long int yres = ULI_TO_LI(vinfo.vinfo.yres);
170170

171171
SET_PIXEL_OR_IGNORE(fbnum, x0, y0 + rad, xres, yres, color);
172172
SET_PIXEL_OR_IGNORE(fbnum, x0, y0 - rad, xres, yres, color);

pyframebuffer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __enter__(self):
6161
self.xres = xres
6262
self.yres = yres
6363
self.depth = depth
64-
finally:
64+
except:
6565
fb.pyfb_close(self.fbnum)
6666

6767
self.opened = True

0 commit comments

Comments
 (0)