mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-13 02:42:47 +01:00
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:
parent
de3b9a77e4
commit
538b48d08d
5
drw.c
5
drw.c
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "drw.h"
|
#include "drw.h"
|
||||||
#include "shm_open.h"
|
#include "shm_open.h"
|
||||||
|
#include "math.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
drwsurf_resize(struct drwsurf *ds, uint32_t w, uint32_t h, double s)
|
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->scale = s;
|
||||||
ds->width = w * s;
|
ds->width = ceil(w * s);
|
||||||
ds->height = h * s;
|
ds->height = ceil(h * s);
|
||||||
|
|
||||||
setup_buffer(ds);
|
setup_buffer(ds);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user