mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Fix NET14 Spans defaulting to ReadOnlySpan
This commit is contained in:
parent
c9276b1771
commit
d47a41b295
4 changed files with 11 additions and 11 deletions
|
|
@ -238,7 +238,7 @@ public static unsafe partial class ImGui
|
|||
ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector2, float>(new(ref v)),
|
||||
MemoryMarshal.Cast<Vector2, float>(new Span<Vector2>(ref v)),
|
||||
vSpeed,
|
||||
vMin,
|
||||
vMax,
|
||||
|
|
@ -251,7 +251,7 @@ public static unsafe partial class ImGui
|
|||
ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector3, float>(new(ref v)),
|
||||
MemoryMarshal.Cast<Vector3, float>(new Span<Vector3>(ref v)),
|
||||
vSpeed,
|
||||
vMin,
|
||||
vMax,
|
||||
|
|
@ -264,7 +264,7 @@ public static unsafe partial class ImGui
|
|||
ImGuiSliderFlags flags = ImGuiSliderFlags.None) => DragScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector4, float>(new(ref v)),
|
||||
MemoryMarshal.Cast<Vector4, float>(new Span<Vector4>(ref v)),
|
||||
vSpeed,
|
||||
vMin,
|
||||
vMax,
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ public static unsafe partial class ImGui
|
|||
InputScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector2, float>(new(ref data)),
|
||||
MemoryMarshal.Cast<Vector2, float>(new Span<Vector2>(ref data)),
|
||||
step,
|
||||
stepFast,
|
||||
format.MoveOrDefault("%.3f"u8),
|
||||
|
|
@ -219,7 +219,7 @@ public static unsafe partial class ImGui
|
|||
InputScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector3, float>(new(ref data)),
|
||||
MemoryMarshal.Cast<Vector3, float>(new Span<Vector3>(ref data)),
|
||||
step,
|
||||
stepFast,
|
||||
format.MoveOrDefault("%.3f"u8),
|
||||
|
|
@ -233,7 +233,7 @@ public static unsafe partial class ImGui
|
|||
InputScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector4, float>(new(ref data)),
|
||||
MemoryMarshal.Cast<Vector4, float>(new Span<Vector4>(ref data)),
|
||||
step,
|
||||
stepFast,
|
||||
format.MoveOrDefault("%.3f"u8),
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ public static unsafe partial class ImGui
|
|||
ImU8String format = default, ImGuiSliderFlags flags = ImGuiSliderFlags.None) => SliderScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector2, float>(new(ref v)),
|
||||
MemoryMarshal.Cast<Vector2, float>(new Span<Vector2>(ref v)),
|
||||
vMin,
|
||||
vMax,
|
||||
format.MoveOrDefault("%.3f"u8),
|
||||
|
|
@ -222,7 +222,7 @@ public static unsafe partial class ImGui
|
|||
SliderScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector3, float>(new(ref v)),
|
||||
MemoryMarshal.Cast<Vector3, float>(new Span<Vector3>(ref v)),
|
||||
vMin,
|
||||
vMax,
|
||||
format.MoveOrDefault("%.3f"u8),
|
||||
|
|
@ -236,7 +236,7 @@ public static unsafe partial class ImGui
|
|||
SliderScalar(
|
||||
label,
|
||||
ImGuiDataType.Float,
|
||||
MemoryMarshal.Cast<Vector4, float>(new(ref v)),
|
||||
MemoryMarshal.Cast<Vector4, float>(new Span<Vector4>(ref v)),
|
||||
vMin,
|
||||
vMax,
|
||||
format.MoveOrDefault("%.3f"u8),
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ public ref struct ImU8String
|
|||
|
||||
return this.rentedBuffer is { } buf
|
||||
? buf.AsSpan()
|
||||
: MemoryMarshal.Cast<FixedBufferContainer, byte>(new(ref Unsafe.AsRef(ref this.fixedBuffer)));
|
||||
: MemoryMarshal.Cast<FixedBufferContainer, byte>(new Span<FixedBufferContainer>(ref Unsafe.AsRef(ref this.fixedBuffer)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ public ref struct ImU8String
|
|||
private ref byte FixedBufferByteRef => ref this.FixedBufferSpan[0];
|
||||
|
||||
private Span<byte> FixedBufferSpan =>
|
||||
MemoryMarshal.Cast<FixedBufferContainer, byte>(new(ref Unsafe.AsRef(ref this.fixedBuffer)));
|
||||
MemoryMarshal.Cast<FixedBufferContainer, byte>(new Span<FixedBufferContainer>(ref Unsafe.AsRef(ref this.fixedBuffer)));
|
||||
|
||||
public static implicit operator ImU8String(ReadOnlySpan<byte> text) => new(text);
|
||||
public static implicit operator ImU8String(ReadOnlyMemory<byte> text) => new(text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue