nitpicker: report both xpos,ypos for pointer

Don't omit either attribute whenever the value is 0. If the pointer is
defined, both attributes are reported. This way, the presence/absence
of the attribute expresses the validity of the pointer.

Issue #5370
This commit is contained in:
Norman Feske 2025-03-19 13:43:15 +01:00
parent 2e48641c13
commit 38650149b6

View File

@ -446,8 +446,11 @@ void User_state::report_keystate(Xml_generator &xml) const
void User_state::report_pointer_position(Xml_generator &xml) const
{
_pointer.with_result([&] (Point p) { gen_attr(xml, p); },
[&] (Nowhere) { });
_pointer.with_result(
[&] (Point p) {
xml.attribute("xpos", p.x);
xml.attribute("ypos", p.y); },
[&] (Nowhere) { });
}