From 8579fc9870bd8b1e38c0a1e44e4db24e57222231 Mon Sep 17 00:00:00 2001 From: George Atkinson Date: Wed, 20 Apr 2022 01:34:12 +0200 Subject: [PATCH] Fix for row/col spacing not scaling with DPI change --- core/src/layout/node.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/layout/node.rs b/core/src/layout/node.rs index 4bb2e623d..4bda766ef 100644 --- a/core/src/layout/node.rs +++ b/core/src/layout/node.rs @@ -217,11 +217,17 @@ impl<'w> Node<'w> for Entity { } fn row_between(&self, store: &Self::Data) -> Option { - 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 { - 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 {