nitpicker: apply domain constraints to GUI info

If a <domain> is constrained by 'width' or 'height' attributes, clip
the capture rects of the panorama info reported to the client. So the
client observes the constraint as window size.

Issue #5356
This commit is contained in:
Norman Feske 2024-10-22 17:48:00 +02:00 committed by Christian Helmuth
parent 5e3b6ee08f
commit 08bf219b28
2 changed files with 3 additions and 3 deletions

View File

@ -183,11 +183,11 @@ class Nitpicker::Capture_session : public Session_object<Capture::Session>
_policy_changed = true;
}
void gen_capture_attr(Xml_generator &xml) const
void gen_capture_attr(Xml_generator &xml, Rect const domain_panorama) const
{
xml.attribute("name", label());
gen_attr(xml, bounding_box());
gen_attr(xml, Rect::intersect(domain_panorama, bounding_box()));
unsigned const w_mm = _policy.w_mm.or_default(_buffer_attr.mm.w),
h_mm = _policy.h_mm.or_default(_buffer_attr.mm.h);

View File

@ -361,7 +361,7 @@ class Nitpicker::Capture_root : public Root_component<Capture_session>
{
gen_attr(xml, domain_panorama);
_sessions.for_each([&] (Capture_session const &capture) {
xml.node("capture", [&] { capture.gen_capture_attr(xml); }); });
xml.node("capture", [&] { capture.gen_capture_attr(xml, domain_panorama); }); });
}
};