WPFHelper.measure_content() rounds to layout correctly

This commit is contained in:
John Colvin committed 2019-11-13 21:07:07 -06:00
1 parent 0191856733
commit ec9967f9f0
1 file changed
+7 -6
+7 -6
View File
@@ -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);