Fix some visual bugs w/ edit predictions (#24591)
* correct the size of key binding icons * avoid spurious modifier in 'jump to edit' popover when already previewing * fix height of the edit preview popover Release Notes: - N/A Co-authored-by: agu-z <hi@aguz.me>
This commit is contained in:
parent
dab9c41799
commit
929c5e76b4
6 changed files with 37 additions and 34 deletions
|
@ -2975,6 +2975,22 @@ impl AbsoluteLength {
|
|||
AbsoluteLength::Rems(rems) => rems.to_pixels(rem_size),
|
||||
}
|
||||
}
|
||||
|
||||
/// Converts an `AbsoluteLength` to `Rems` based on a given `rem_size`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `rem_size` - The size of one rem in pixels.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// Returns the `AbsoluteLength` as `Pixels`.
|
||||
pub fn to_rems(&self, rem_size: Pixels) -> Rems {
|
||||
match self {
|
||||
AbsoluteLength::Pixels(pixels) => Rems(pixels.0 / rem_size.0),
|
||||
AbsoluteLength::Rems(rems) => *rems,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for AbsoluteLength {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue