From 8a8c97f90a4e5bcd0576abe99895fd17732052de Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Sat, 20 Jun 2026 12:57:32 +0800 Subject: [PATCH] fix(editor): align text-align toggle hit rects with paint + refresh stale tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex/multi-agent review found the text h/v-align ToggleGroup hit rects sat 14px (LH_LS_LABEL_H) above where they paint: text_action_rects omitted the 行高/字间距 caption row that paint_text_section and push_text_input_rects both include, so the bottom half of each align toggle was a dead zone and the band above misfired. Add the missing LH_LS_LABEL_H term. Also refresh two tests left stale by the jian Button migration (kit-dropdown pressed-feedback radius 4→6; code Export-bundle hover wash now jian Ghost's button_hover, not a boosted alpha). --- crates/op-editor-ui/src/widgets/component_browser_kits.rs | 2 +- crates/op-editor-ui/src/widgets/property_panel_code_tests.rs | 4 ++-- crates/op-editor-ui/src/widgets/property_panel_text.rs | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/op-editor-ui/src/widgets/component_browser_kits.rs b/crates/op-editor-ui/src/widgets/component_browser_kits.rs index 8755030d9..9acb8e5c3 100644 --- a/crates/op-editor-ui/src/widgets/component_browser_kits.rs +++ b/crates/op-editor-ui/src/widgets/component_browser_kits.rs @@ -707,7 +707,7 @@ mod tests { .round_fills .iter() .any(|(fill, radius, color)| *fill == dropdown - && *radius == 4.0 + && *radius == 6.0 && *color == expected), "pressed kit dropdown should paint shared pressed feedback" ); diff --git a/crates/op-editor-ui/src/widgets/property_panel_code_tests.rs b/crates/op-editor-ui/src/widgets/property_panel_code_tests.rs index a0d66f312..de09d839c 100644 --- a/crates/op-editor-ui/src/widgets/property_panel_code_tests.rs +++ b/crates/op-editor-ui/src/widgets/property_panel_code_tests.rs @@ -239,8 +239,8 @@ fn idle_bundle_hover_paints_neutral_feedback() { .iter() .any(|(r, c)| rect_eq(*r, bundle_rect) && !color_eq(*c, theme.muted) - && c.a > theme.button_hover.a + 0.01), - "hovered borderless Export AI Bundle should paint a visible wash over the transparent button" + && color_eq(*c, theme.button_hover)), + "hovered borderless Export AI Bundle should paint jian Ghost's button_hover wash over the transparent button" ); } diff --git a/crates/op-editor-ui/src/widgets/property_panel_text.rs b/crates/op-editor-ui/src/widgets/property_panel_text.rs index 6681a29a5..2db412776 100644 --- a/crates/op-editor-ui/src/widgets/property_panel_text.rs +++ b/crates/op-editor-ui/src/widgets/property_panel_text.rs @@ -134,6 +134,11 @@ pub fn text_action_rects(x0: f32, y: f32, usable_w: f32) -> Vec<(PropertyPanelAc + FAMILY_ROW_GAP + INPUT_HEIGHT + 6.0 + // The 行高/字间距 caption row sits between the weight/size row and the + // LH/LS inputs — paint_text_section + push_text_input_rects both + // include it, so the align-row hit anchor must too (else the align + // ToggleGroup hit rects drift 14px above where they paint). + + LH_LS_LABEL_H + INPUT_HEIGHT + 8.0 + ALIGN_LABEL_H;