Skip to content

Commit

Permalink
Fix for row/col spacing not scaling with DPI change
Browse files Browse the repository at this point in the history
  • Loading branch information
geom3trik committed Apr 19, 2022
1 parent 001c20b commit 8579fc9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/layout/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,17 @@ impl<'w> Node<'w> for Entity {
}

fn row_between(&self, store: &Self::Data) -> Option<morphorm::Units> {
store.0.row_between.get(*self).cloned()
store.0.row_between.get(*self).cloned().map(|v| match v {
Units::Pixels(val) => Units::Pixels(val * store.0.dpi_factor as f32),
t => t,
})
}

fn col_between(&self, store: &Self::Data) -> Option<morphorm::Units> {
store.0.col_between.get(*self).cloned()
store.0.col_between.get(*self).cloned().map(|v| match v {
Units::Pixels(val) => Units::Pixels(val * store.0.dpi_factor as f32),
t => t,
})
}

fn border_left(&self, store: &Self::Data) -> Option<morphorm::Units> {
Expand Down

0 comments on commit 8579fc9

Please sign in to comment.