feat: ImGuiHelpers.GetButtonSize()

This commit is contained in:
goat 2021-09-17 23:41:06 +02:00
parent 59ba3bdd07
commit b779ac5674
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 9 additions and 4 deletions

View file

@ -105,6 +105,13 @@ namespace Dalamud.Interface
return colorPalette;
}
/// <summary>
/// Get the size of a button considering the default frame padding.
/// </summary>
/// <param name="text">Text in the button.</param>
/// <returns><see cref="Vector2"/> with the size of the button.</returns>
public static Vector2 GetButtonSize(string text) => ImGui.CalcTextSize(text) + (ImGui.GetStyle().FramePadding * 2);
/// <summary>
/// Get data needed for each new frame.
/// </summary>