fix fractional scalled buffer missing one pixel

Before 1920*1080 scaled 1.40 was giving a buffer width of 1919 pixels.

The buffer dimensions have to be ceiled here, instead of rounded.

The rest of the dimensions have to stay the same, here 1371x120.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
Willow Barraco 2024-01-30 09:35:03 +01:00 committed by Maarten van Gompel
parent de3b9a77e4
commit 538b48d08d

5
drw.c
View File

@ -4,6 +4,7 @@
#include "drw.h"
#include "shm_open.h"
#include "math.h"
void
drwsurf_resize(struct drwsurf *ds, uint32_t w, uint32_t h, double s)
@ -15,8 +16,8 @@ drwsurf_resize(struct drwsurf *ds, uint32_t w, uint32_t h, double s)
}
ds->scale = s;
ds->width = w * s;
ds->height = h * s;
ds->width = ceil(w * s);
ds->height = ceil(h * s);
setup_buffer(ds);
}