mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +01:00
Better rounding
This commit is contained in:
parent
2bfddaae16
commit
f172ee2308
3 changed files with 83 additions and 12 deletions
|
|
@ -202,7 +202,7 @@ public static class ImGuiHelpers
|
|||
/// <param name="round">If a positive number is given, numbers will be rounded to this.</param>
|
||||
public static unsafe void AdjustGlyphMetrics(this ImFontPtr fontPtr, float scale, float round = 0f)
|
||||
{
|
||||
Func<float, float> rounder = round > 0 ? x => MathF.Round(x * round) / round : x => x;
|
||||
Func<float, float> rounder = round > 0 ? x => MathF.Round(x / round) * round : x => x;
|
||||
|
||||
var font = fontPtr.NativePtr;
|
||||
font->FontSize = rounder(font->FontSize * scale);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue