From bca6e772f55d96dda33978e2b4026bc13c2d738f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 13:47:50 -0800 Subject: [PATCH] Tests: Cutout and Objects on Path clicks wait for the CJK font lookup The Japanese pass of gallery_cutout_setting_uses_its_localized_label and compact_objects_on_path_options_pivot_rotate_reset_and_save measures controls in one frame and clicks the saved positions in later frames. When the CJK font lookup finishes in between, the labels change width and the click can miss. Both tests now call wait_for_cjk_fonts() before measuring, as #9898 did for the Effect Gallery and Hyphenation tests. --- crates/ui-egui/src/dialogs/effect_params.rs | 2 ++ crates/ui-egui/src/dialogs/objects_on_path_options.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/ui-egui/src/dialogs/effect_params.rs b/crates/ui-egui/src/dialogs/effect_params.rs index 10028d3c4b..fc8fd14c9d 100644 --- a/crates/ui-egui/src/dialogs/effect_params.rs +++ b/crates/ui-egui/src/dialogs/effect_params.rs @@ -313,6 +313,8 @@ mod tests { #[test] fn gallery_cutout_setting_uses_its_localized_label() { + // The Japanese pass measures Cutout in one frame and clicks it in a later one. + crate::testing::wait_for_cjk_fonts(); let viewport = Rect::from_min_size(Pos2::ZERO, vec2(800.0, 500.0)); let mut shown_labels = Vec::new(); for (language, expected) in [("en", "Levels"), ("de", "Stufen"), ("ja", "レベル数")] { diff --git a/crates/ui-egui/src/dialogs/objects_on_path_options.rs b/crates/ui-egui/src/dialogs/objects_on_path_options.rs index cfc699334e..cd1eb96f98 100644 --- a/crates/ui-egui/src/dialogs/objects_on_path_options.rs +++ b/crates/ui-egui/src/dialogs/objects_on_path_options.rs @@ -77,6 +77,8 @@ fn compact_objects_on_path_options_pivot_rotate_reset_and_save() { } const PIVOT_NAMES: [&str; 9] = ["Top Left", "Top", "Top Right", "Left", "Center", "Right", "Bottom Left", "Bottom", "Bottom Right"]; + // The Japanese pass measures the controls once and clicks them frames later. + crate::testing::wait_for_cjk_fonts(); let screen = Rect::from_min_size(Pos2::ZERO, vec2(800.0, 500.0)); let mut untranslated = Vec::new(); for lang in ["en", "de", "fr", "ja"] {