This commit is contained in:
MrSubidubi 2025-08-12 19:53:57 +02:00
parent d705585a2e
commit c28d873a2f
34 changed files with 1295 additions and 2348 deletions

View file

@ -254,7 +254,7 @@ impl ToTaffy<taffy::style::Style> for Style {
taffy::style::Style {
display: self.display.into(),
overflow: self.overflow.into(),
scrollbar_width: self.scrollbar_width,
scrollbar_width: self.scrollbar_width.to_taffy(rem_size),
position: self.position.into(),
inset: self.inset.to_taffy(rem_size),
size: self.size.to_taffy(rem_size),
@ -279,6 +279,15 @@ impl ToTaffy<taffy::style::Style> for Style {
}
}
impl ToTaffy<f32> for AbsoluteLength {
fn to_taffy(&self, rem_size: Pixels) -> f32 {
match self {
AbsoluteLength::Pixels(pixels) => pixels.into(),
AbsoluteLength::Rems(rems) => (*rems * rem_size).into(),
}
}
}
impl ToTaffy<taffy::style::LengthPercentageAuto> for Length {
fn to_taffy(&self, rem_size: Pixels) -> taffy::prelude::LengthPercentageAuto {
match self {