From 5b3749e34a634d85b0342bfb370a6ccd0301bca5 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 13 Nov 2026 13:47:04 +0000 Subject: [PATCH] docs: PaintUi::measure in contract-api --- docs/contract-api.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/contract-api.md b/docs/contract-api.md index c489f47a8..7e343d690 100644 --- a/docs/contract-api.md +++ b/docs/contract-api.md @@ -2217,6 +2217,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st - `pub fn clipped(&mut self, rect: Rect, paint: impl FnOnce(&mut Self) -> R) -> R`. Runs `paint` with this `PaintUi` cut to `rect` (inside the clip already in force), as `Draw::clipped` does for a - `pub fn with_style(&self, variant: Variant, f: impl FnOnce(&StyleCx<'_>) -> R) -> R`. Runs `f` with the style context of this component's env, so app hooks called from `paint` pick colours and - `pub fn child(&mut self, key: impl Hash + Debug, rect: Rect, child: C) -> C::Output`. Shows a child component at a physical rect, with id `cx.key(key)`. The child `Ui` is pinned left to + - `pub fn measure(&self, key: impl Hash + Debug, child: &mut C, proposal: craft_behavior::Proposal) -> egui::Vec2`. Measures a child under the composite's resolved `enabled` and `size`, as [`child`](Self::child) with the same key will show it: for a composite that places its children by their size. - `pub fn inner(&mut self, key: impl Hash + Debug, rect: Rect, child: C) -> C::Output`. Shows `child` as the owner's own control, such as a picker the owner draws its field with. The child's node - `pub fn child_with_tip(&mut self, key: impl Hash + Debug, rect: Rect, child: C, tip: impl FnOnce(&mut Ui)) -> C::Output`. Shows a child with rich tooltip content. - `pub fn labelled(&mut self, key: impl Hash + Debug, rect: Rect, label: Label, side: SideLabel, child: C) -> C::Output`. Runs the label step (B2) for one leaf child at `rect`: the label's placement beside or above the child, the