From 1fb19ee023735452565c420557283538569ffa40 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 23 Oct 2022 22:38:38 +0200 Subject: [PATCH] Adjust content view items to whole pixels to reduce text aliasing #794 --- Source/Editor/Content/GUI/ContentView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Content/GUI/ContentView.cs b/Source/Editor/Content/GUI/ContentView.cs index 6825910bc..a7dc7b18f 100644 --- a/Source/Editor/Content/GUI/ContentView.cs +++ b/Source/Editor/Content/GUI/ContentView.cs @@ -718,11 +718,11 @@ namespace FlaxEditor.Content.GUI float defaultItemsWidth = ContentItem.DefaultWidth * viewScale; int itemsToFit = Mathf.FloorToInt(width / defaultItemsWidth) - 1; if (itemsToFit < 1) - { itemsToFit = 1; - } float itemsWidth = width / Mathf.Max(itemsToFit, 1); + itemsWidth = Mathf.Floor(itemsWidth); float itemsHeight = itemsWidth / defaultItemsWidth * (ContentItem.DefaultHeight * viewScale); + itemsHeight = Mathf.Floor(itemsHeight); x = itemsToFit == 1 ? 0 : itemsWidth / itemsToFit; for (int i = 0; i < _children.Count; i++) {