Use ImU8String for SafeTextColored

This commit is contained in:
Haselnussbomber 2025-08-04 21:03:38 +02:00
parent 81c3ad9421
commit c8a7c712c1
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1

View file

@ -246,16 +246,7 @@ public static partial class ImGuiHelpers
/// </summary> /// </summary>
/// <param name="color">The color of the text.</param> /// <param name="color">The color of the text.</param>
/// <param name="text">The text to write.</param> /// <param name="text">The text to write.</param>
public static void SafeTextColored(Vector4 color, string text) public static void SafeTextColored(Vector4 color, ImU8String text)
{
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
ImGui.TextUnformatted(text);
}
}
/// <inheritdoc cref="SafeTextColored(Vector4, string)"/>
public static void SafeTextColored(Vector4 color, ReadOnlySpan<byte> text)
{ {
using (ImRaii.PushColor(ImGuiCol.Text, color)) using (ImRaii.PushColor(ImGuiCol.Text, color))
{ {