Skip to content

wp-fractional-scale-v1: warn about rounding calculation errors

This would partially address #132.

This MR adds text describing the issue. The vast majority of practical scale values (like 1.5, 1.33333, 1.25) are not affected; only less usual scales like 131/120 are. I think that exact calculation is the only reasonable interpretation of the protocol; wanting everyone to agree on a specific floating calculation and its errors would a) still require changes from many parties b) generate subtle bugs from associative-math compiler optimizations, precision upgrading (which some programming languages may apply by default), and rounding mode c) introduce a dependency on floating point calculations, which Wayland so far has avoided d) set a bad example for future protocols.

It does not give specific solutions, because I think the issue is actually a bit larger than just computing the buffer size; clients or compositors may also want to map e.g. logical coordinates or mouse coordinates to or from buffer coordinates. (Edit: now gives a formula.)

Edited by M. Stoeckl

Merge request reports