53 std::uint32_t viewport_width,
54 std::uint32_t viewport_height,
56 const char* parent_label) {
62 const float cw =
view.flex().preferred_width;
63 const float ch =
view.flex().preferred_height;
64 if (cw <= 0 && ch <= 0)
return;
78 const bool size_x_is_explicit = cw > 0 && !
view.has_right();
79 const bool size_y_is_explicit = ch > 0 && !
view.has_bottom();
81 if (cw >
vw && size_x_is_explicit) {
82 view.flex().preferred_width =
vw;
85 if (ch >
vh && size_y_is_explicit) {
86 view.flex().preferred_height =
vh;
89 if (clamped && std::getenv(
"PULP_DUMP_BOUNDS")) {
91 "[viewport-reconcile] clamped oversize node depth=%d parent=%s: "
92 "(%.0fx%.0f) -> (%.0fx%.0f) in %ux%u viewport\n",
94 parent_label ? parent_label :
"<root>",
96 view.flex().preferred_width,
97 view.flex().preferred_height,
98 viewport_width, viewport_height);
104 std::uint32_t viewport_width,
105 std::uint32_t viewport_height,
107 const char* parent_label) {
110 viewport_width, viewport_height,
111 depth, parent_label);
112 char child_label[64];
113 std::snprintf(child_label,
sizeof(child_label),
"depth%d", depth);
114 for (std::size_t
i = 0;
i <
view.child_count(); ++
i) {
115 auto* child =
const_cast<View*
>(
view.child_at(
i));
116 if (!child)
continue;
118 viewport_width, viewport_height,
119 depth + 1, child_label);
142 if (!raw)
return false;
143 const std::string_view
value{raw};
144 if (
value.empty())
return false;
149 std::uint32_t viewport_width,
150 std::uint32_t viewport_height) {
152 const float vw =
static_cast<float>(viewport_width);
153 const float vh =
static_cast<float>(viewport_height);
158 if (!child)
continue;
160 viewport_width, viewport_height,
View * child_at(size_t index)
Definition view.hpp:161
size_t child_count() const
Definition view.hpp:160
@ fixed
Definition view.hpp:1753
@ absolute
Definition view.hpp:1753
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
void walk_and_clamp(pulp::view::View &view, float vw, float vh, std::uint32_t viewport_width, std::uint32_t viewport_height, int depth, const char *parent_label)
Definition viewport_reconcile.hpp:102
bool reconcile_disabled_by_env(const char *raw)
Whether a caller has opted out of reconciliation, given the raw value of PULP_SHOT_NO_RECONCILE (null...
Definition viewport_reconcile.hpp:141
@ vh
Percentage of viewport height.
Definition geometry.hpp:396
@ vw
Percentage of viewport width.
Definition geometry.hpp:395
void reconcile_oversize_absolute_subtree(pulp::view::View &root, std::uint32_t viewport_width, std::uint32_t viewport_height)
Definition viewport_reconcile.hpp:148
void clamp_oversize_absolute_view(pulp::view::View &view, float vw, float vh, std::uint32_t viewport_width, std::uint32_t viewport_height, int depth, const char *parent_label)
Definition viewport_reconcile.hpp:51
@ value
the widget's primary value (Knob, Fader, RangeSlider, Toggle, ProgressBar)
Definition binding_diagnostics.hpp:19
@ i
Definition input_events.hpp:40