Fix clipping in meta edits.

This commit is contained in:
Ottermandias 2025-05-18 12:31:13 +02:00
parent 08e8b9d2a4
commit 52927ff06b
2 changed files with 8 additions and 4 deletions

@ -1 +1 @@
Subproject commit f130c928928cb0d48d3c807b7df5874c2460fe98
Subproject commit 9aeda9a892d9b971e32b10db21a8daf9c0b9ee53

View file

@ -44,9 +44,13 @@ public abstract class MetaDrawer<TIdentifier, TEntry>(ModMetaEditor editor, Meta
DrawNew();
var height = ColumnHeight;
var skips = ImGuiClip.GetNecessarySkipsAtPos(height, ImGui.GetCursorPosY());
var remainder = ImGuiClip.ClippedTableDraw(Enumerate(), skips, DrawLine, Count);
ImGuiClip.DrawEndDummy(remainder, height);
var skips = ImGuiClip.GetNecessarySkipsAtPos(height, ImGui.GetCursorPosY(), Count);
if (skips < Count)
{
var remainder = ImGuiClip.ClippedTableDraw(Enumerate(), skips, DrawLine, Count);
if (remainder > 0)
ImGuiClip.DrawEndDummy(remainder, height);
}
void DrawLine((TIdentifier Identifier, TEntry Value) pair)
=> DrawEntry(pair.Identifier, pair.Value);