You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix the off-by-one invlets by adjusting the order of operations
We want to avoid assigning invlets to rows that are not visible to the
user, so we use ImGui::IsItemVisible() to test whether we are on a
visible row of the table.
However, IsItemVisible() only tests the visibility of the most recent
item, not the item you are about to create. When we call it for the
first key binding it is telling us that the header row of the table is
hidden, which is not what we wanted to know.
The fix is to draw the other columns first, then go back and decide on
the invlet and draw the first column. Note in particular that we
cannot draw the first column after the second column, because the
second column only conditionally creates an item. It would have been
fine to do it after the third column, but I did it after the fourth
and final column so that all the normal stuff is done first before we
get to the tricky one.
0 commit comments