commit e2f6f63
Devine Lu Linvega
·
2025-04-09 01:44:04 +0000 UTC
parent ea5da14
Fixed issue with zoom
2 files changed,
+6,
-3
+0,
-2
1@@ -72,8 +72,6 @@ screen_apply(int width, int height)
2 clamp(height, 8, 0x800);
3 length = MAR2(width) * MAR2(height);
4 uxn_screen.bg = realloc(uxn_screen.bg, length), uxn_screen.fg = realloc(uxn_screen.fg, length);
5- uxn_screen.pixels = realloc(uxn_screen.pixels,
6- width * height * sizeof(Uint32) * uxn_screen.zoom * uxn_screen.zoom);
7 uxn_screen.width = width, uxn_screen.height = height;
8 screen_change(0, 0, width, height);
9 uxn_screen.resize = 1;
+6,
-1
1@@ -86,8 +86,13 @@ emu_resize(void)
2 {
3 int width = uxn_screen.width * uxn_screen.zoom;
4 int height = uxn_screen.height * uxn_screen.zoom;
5- if(ximage) XDestroyImage(ximage);
6+ uxn_screen.pixels = realloc(uxn_screen.pixels,
7+ uxn_screen.width * uxn_screen.height * sizeof(Uint32) * uxn_screen.zoom * uxn_screen.zoom);
8 ximage = XCreateImage(display, DefaultVisual(display, 0), DefaultDepth(display, DefaultScreen(display)), ZPixmap, 0, (char *)uxn_screen.pixels, width, height, 32, 0);
9+ uxn_screen.x1 = uxn_screen.y1 = 0;
10+ uxn_screen.x2 = uxn_screen.width;
11+ uxn_screen.y2 = uxn_screen.height;
12+ emu_repaint();
13 XResizeWindow(display, window, width, height);
14 uxn_screen.resize = 0;
15 }