fix(multi): resolve 3 remaining Android UI bugs
Android Release / build-apk (push) Successful in 3m33s

- radial_menu: replace active_id.unwrap() with let Some guard — no
  runtime panic possible even if DragState races (§2.3)
- card_plugin: add bottom-right AndroidCornerBg overlay to mask the
  rotated baked-in text on classic PNG cards (mirrors top-left treatment)
- hud_plugin: bump Android action button min_width 44→52 px to give
  ~22px glyphs adequate padding after dynamic font-size increase
- layout: fix doc-lazy-continuation clippy lint in BOTTOM_BAR_HEIGHT comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-19 15:16:24 -07:00
parent ec94cb34aa
commit 6cd8c6c013
4 changed files with 23 additions and 5 deletions
+15 -1
View File
@@ -1147,7 +1147,7 @@ fn add_android_corner_label(
let bg_w = font_size * 2.0; let bg_w = font_size * 2.0;
let bg_h = font_size * 1.25; let bg_h = font_size * 1.25;
// Background covers the PNG's baked-in small corner text. // Background covers the PNG's baked-in small corner text (top-left).
// Classic PNG cards have a white face, so the background must be white too. // Classic PNG cards have a white face, so the background must be white too.
// (CARD_FACE_COLOUR is the Terminal theme's dark face colour — wrong here.) // (CARD_FACE_COLOUR is the Terminal theme's dark face colour — wrong here.)
parent.spawn(( parent.spawn((
@@ -1163,6 +1163,20 @@ fn add_android_corner_label(
0.015, 0.015,
), ),
)); ));
// Cover the matching rotated baked-in text at the bottom-right corner.
parent.spawn((
AndroidCornerBg,
Sprite {
color: Color::WHITE,
custom_size: Some(Vec2::new(bg_w, bg_h)),
..default()
},
Transform::from_xyz(
card_size.x / 2.0 - inset - bg_w / 2.0,
-card_size.y / 2.0 + inset + bg_h / 2.0,
0.015,
),
));
// Large rank+suit text drawn on top of the background. FiraMono must be // Large rank+suit text drawn on top of the background. FiraMono must be
// wired here explicitly — the suit glyphs (U+2660U+2666) are not in // wired here explicitly — the suit glyphs (U+2660U+2666) are not in
+1 -1
View File
@@ -989,7 +989,7 @@ fn spawn_action_button<M: Component>(
// centred with room to breathe. On desktop, keep the comfortable 48 dp // centred with room to breathe. On desktop, keep the comfortable 48 dp
// floor and 8 dp side padding. // floor and 8 dp side padding.
#[cfg(target_os = "android")] #[cfg(target_os = "android")]
let (pad, min_w, min_h) = (UiRect::axes(Val::Px(4.0), Val::Px(4.0)), Val::Px(44.0), Val::Px(44.0)); let (pad, min_w, min_h) = (UiRect::axes(Val::Px(4.0), Val::Px(4.0)), Val::Px(52.0), Val::Px(44.0));
#[cfg(not(target_os = "android"))] #[cfg(not(target_os = "android"))]
let (pad, min_w, min_h) = (UiRect::axes(VAL_SPACE_2, VAL_SPACE_2), Val::Px(48.0), Val::Px(48.0)); let (pad, min_w, min_h) = (UiRect::axes(VAL_SPACE_2, VAL_SPACE_2), Val::Px(48.0), Val::Px(48.0));
+1
View File
@@ -117,6 +117,7 @@ pub const HUD_BAND_HEIGHT: f32 = 112.0;
/// ///
/// Derivation (Android): `min_height 44 px` buttons /// Derivation (Android): `min_height 44 px` buttons
/// + `padding.top 8 px` + `padding.bottom 8 px` outer bar padding = **60 px**. /// + `padding.top 8 px` + `padding.bottom 8 px` outer bar padding = **60 px**.
///
/// Desktop: no persistent bottom bar, so 0. /// Desktop: no persistent bottom bar, so 0.
#[cfg(not(target_os = "android"))] #[cfg(not(target_os = "android"))]
const BOTTOM_BAR_HEIGHT: f32 = 0.0; const BOTTOM_BAR_HEIGHT: f32 = 0.0;
+6 -3
View File
@@ -473,8 +473,11 @@ fn radial_open_on_long_press(
mut state: ResMut<RightClickRadialState>, mut state: ResMut<RightClickRadialState>,
) { ) {
// Guard: only count while a touch is down, uncommitted, and radial is idle. // Guard: only count while a touch is down, uncommitted, and radial is idle.
let active_id = drag.active_touch_id; let Some(active_id) = drag.active_touch_id else {
if active_id.is_none() || drag.committed || state.is_active() || paused.is_some_and(|p| p.0) { *hold_timer = 0.0;
return;
};
if drag.committed || state.is_active() || paused.is_some_and(|p| p.0) {
*hold_timer = 0.0; *hold_timer = 0.0;
return; return;
} }
@@ -487,7 +490,7 @@ fn radial_open_on_long_press(
// Resolve current touch world position. // Resolve current touch world position.
let Some(touches) = touches else { return }; let Some(touches) = touches else { return };
let Some(touch) = touches.iter().find(|t| t.id() == active_id.unwrap()) else { let Some(touch) = touches.iter().find(|t| t.id() == active_id) else {
return; return;
}; };
let Some((camera, cam_xf)) = cameras.single().ok() else { return }; let Some((camera, cam_xf)) = cameras.single().ok() else { return };