From ec9967f9f0e60f7da22681f7de1c598fdfbc0f99 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 29 Oct 2019 14:02:57 -0500 Subject: [PATCH] WPFHelper.measure_content() rounds to layout correctly --- src/client/spark/view/Utility/WPFHelper.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/client/spark/view/Utility/WPFHelper.cs b/src/client/spark/view/Utility/WPFHelper.cs index bbd38e9e5..3b22c74ef 100644 --- a/src/client/spark/view/Utility/WPFHelper.cs +++ b/src/client/spark/view/Utility/WPFHelper.cs @@ -1,4 +1,5 @@ using bts.utils; +using mbts.ui.dpi; using mbts.utils; using System; using System.Collections; @@ -434,12 +435,12 @@ namespace mbts.ui { } } if (use_layout_rounding) { - content_left = Math.Round(content_left); - content_top = Math.Round(content_top); - content_width = Math.Round(content_width); - content_height = Math.Round(content_height); - result_width = Math.Round(result_width); - result_height = Math.Round(result_height); + content_left = content_left.RoundLayoutValue(); + content_top = content_top.RoundLayoutValue(); + content_width = content_width.RoundLayoutValue(); + content_height = content_height.RoundLayoutValue(); + result_width = result_width.RoundLayoutValue(); + result_height = result_height.RoundLayoutValue(); } content_area = new Rect(content_left, content_top, content_width, content_height); resultant_size = new Size(result_width, result_height);