From febaa22a9f29c18777b14b9a2fbd8d38bcc65918 Mon Sep 17 00:00:00 2001
From: Deuce <shurd@sasktel.net>
Date: Sat, 29 Jul 2023 14:29:04 -0400
Subject: [PATCH] Fix non-integer scaling corruption when r2y is NULL

---
 src/conio/bitmap_con.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/conio/bitmap_con.c b/src/conio/bitmap_con.c
index 20102f8274..07f22557ad 100644
--- a/src/conio/bitmap_con.c
+++ b/src/conio/bitmap_con.c
@@ -1689,6 +1689,8 @@ bitmap_get_scaled_win_size_nomax(double scale, int *w, int *h)
 
 	if (scale < 1.0)
 		scale = 1.0;
+	if (ciolib_r2yptr == NULL || ciolib_y2rptr == NULL)
+		scale = floor(scale);
 	*w = lround(vstat.scrnwidth * scale);
 	*h = lround(vstat.scrnheight * scale);
 	if (wc)
@@ -1717,6 +1719,8 @@ bitmap_double_mult_inside(int maxwidth, int maxheight)
 	// TODO: Allow below 1.0?
 	if (mult < 1.0)
 		mult = 1.0;
+	if (ciolib_r2yptr == NULL || ciolib_y2rptr == NULL)
+		mult = floor(mult);
 	return mult;
 }
 
-- 
GitLab