From b94cd7a2a83d81769d31f6379539089ce68cbdcd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Date: Tue, 1 Jun 2021 19:21:43 +0700 Subject: Use `Padding::horizontal` and `Padding::vertical` helpers --- graphics/src/overlay/menu.rs | 4 ++-- graphics/src/widget/pick_list.rs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'graphics') diff --git a/graphics/src/overlay/menu.rs b/graphics/src/overlay/menu.rs index 443f1746..9e91a0ef 100644 --- a/graphics/src/overlay/menu.rs +++ b/graphics/src/overlay/menu.rs @@ -53,7 +53,7 @@ where use std::f32; let is_mouse_over = bounds.contains(cursor_position); - let option_height = (text_size + padding.top + padding.bottom) as usize; + let option_height = (text_size + padding.vertical()) as usize; let mut primitives = Vec::new(); @@ -72,7 +72,7 @@ where x: bounds.x, y: bounds.y + (option_height * i) as f32, width: bounds.width, - height: f32::from(text_size + padding.top + padding.bottom), + height: f32::from(text_size + padding.vertical()), }; if is_selected { diff --git a/graphics/src/widget/pick_list.rs b/graphics/src/widget/pick_list.rs index c6fbcf76..32dfbdf9 100644 --- a/graphics/src/widget/pick_list.rs +++ b/graphics/src/widget/pick_list.rs @@ -57,8 +57,7 @@ where font: B::ICON_FONT, size: bounds.height * style.icon_size, bounds: Rectangle { - x: bounds.x + bounds.width - - f32::from(padding.left + padding.right), + x: bounds.x + bounds.width - f32::from(padding.horizontal()), y: bounds.center_y(), ..bounds }, -- cgit