Clarify shared alignment placement and unit documentation

This commit is contained in:
skylar taylor-barrick
2026-11-16 09:39:13 -06:00
parent 2fa6a062b6
commit 6345e9baa2
2 changed files with 3 additions and 2 deletions
@@ -167,7 +167,8 @@ pub(crate) fn show(ui: &mut Ui, edit: Edit<'_>) -> Shown {
.event_filter(filter)
.return_key(if multiline { Some(egui::KeyboardShortcut::new(egui::Modifiers::NONE, egui::Key::Enter)) } else { None })
.layouter(&mut layouter)
// A laid-out galley sits at the rect's corner, as a painted run does.
// A laid-out galley sits at the rect's corner. Other text follows the same logical placement
// rule as primitives::text::free_room_before, with the row centred vertically.
.align(match (align, rtl) {
_ if galley.is_some() => egui::Align2::LEFT_TOP,
(HAlign::Center, _) => egui::Align2::CENTER_CENTER,
+1 -1
View File
@@ -344,7 +344,7 @@ impl<'a, V: NumberValue + 'static> NumberField<'a, V> {
}
/// The unit, measured, then the chevrons: what sits after the text. The unit stands apart at the end of the value
/// area, so units line up in a column of fields and the number centres in the room before its unit. A
/// area, so units line up in a column of fields; the value's alignment applies within the room before its unit. A
/// content-sized field's unit is as wide as the widest of its column group's.
fn after_text(&self, cx: &MeasureCx<'_, Self>, chevrons: &[(PartKey, Label)]) -> Vec<Adornment> {
let shared = content_sized(cx);