precentage
This commit is contained in:
@@ -116,16 +116,3 @@ pub fn init<'a>(mouse: bool) -> crate::Result<crate::Console<'a>> {
|
||||
mouse_position: None,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn calculate_padding(string_length: usize, width: usize) -> (usize, usize) {
|
||||
if width <= string_length {
|
||||
// No padding needed if the string length is greater than or equal to the width
|
||||
return (0, 0);
|
||||
}
|
||||
|
||||
let total_padding = width - string_length;
|
||||
let left_padding = total_padding / 2; // Floor division for left padding
|
||||
let right_padding = total_padding - left_padding; // Remaining for right padding
|
||||
|
||||
(left_padding, right_padding)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user