[client] wayland: use round half away from zero behaviour

In fractional-scale-v1, the scaling is defined as follows:

> For toplevel surfaces, the size is rounded halfway away from zero.

Previously, it is undefined. This commit makes waylandScaleMulInt follow
the round half away from zero behaviour.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2026-06-06 02:32:23 +10:00
1 parent 938a2a6c22
commit c8edf1eaf3
1 file changed
+1 -1
+1 -1
View File
@@ -71,7 +71,7 @@ static inline int waylandScaleCeil(struct WaylandScale scale)
static inline int waylandScaleMulInt(struct WaylandScale scale, int value)
{
return (int)(((int64_t)value * scale.num) / scale.den);
return (int)(((int64_t)value * scale.num + scale.den / 2) / scale.den);
}
static inline double waylandScaleToDouble(struct WaylandScale scale)