BeginChild() fix using negative sizes as window position because of erroneous clamping. It was hard to notice until we added asserts for it. (#1500)
This commit is contained in:
parent
e8e84a6ad6
commit
f7c5f420e7
@ -3953,9 +3953,9 @@ static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
|
||||
ImVec2 size = ImFloor(size_arg);
|
||||
const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00);
|
||||
if (size.x <= 0.0f)
|
||||
size.x = ImMax(content_avail.x, 4.0f) - fabsf(size.x); // Arbitrary minimum zero-ish child size of 4.0f (0.0f causing too much issues)
|
||||
size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too much issues)
|
||||
if (size.y <= 0.0f)
|
||||
size.y = ImMax(content_avail.y, 4.0f) - fabsf(size.y);
|
||||
size.y = ImMax(content_avail.y + size.y, 4.0f);
|
||||
|
||||
const float backup_border_size = g.Style.ChildBorderSize;
|
||||
if (!border)
|
||||
|
Loading…
Reference in New Issue
Block a user