Providing (-1, -1) for size_min or size_max alone in SetNextWindowSizeConstraints has no effect. #3270

Closed
opened 2020-05-29 05:56:57 +00:00 by trss · 3 comments
trss commented 2020-05-29 05:56:57 +00:00 (Migrated from github.com)

From the documentation below, the obvious thing to do is to provide (-1, -1) for size_max if one wants to provide size_min alone. But this results in size_min not being honored.
ocornut/imgui@3f26a07ee1/imgui.h (L307)

The code below makes it clear why it behaves this way and the fix looks simple.
ocornut/imgui@3f26a07ee1/imgui.cpp (L4946-L4947)

Of course, it's always possible to provide FLT_MAX/INT_MAX. But that took a long while for me to figure out.

If this is the intended behavior, I feel that the documentation could be made clearer.

From the documentation below, the obvious thing to do is to provide `(-1, -1)` for `size_max` if one wants to provide `size_min` alone. But this results in `size_min` not being honored. https://github.com/ocornut/imgui/blob/3f26a07ee1813cecaa87253436149e28fc11dc4e/imgui.h#L307 The code below makes it clear why it behaves this way and the fix looks simple. https://github.com/ocornut/imgui/blob/3f26a07ee1813cecaa87253436149e28fc11dc4e/imgui.cpp#L4946-L4947 Of course, it's always possible to provide `FLT_MAX/INT_MAX`. But that took a long while for me to figure out. If this is the intended behavior, I feel that the documentation could be made clearer.
ocornut commented 2020-06-01 18:49:25 +00:00 (Migrated from github.com)

Hello,
It seems like this has already been reported and there's a pull request here: #3186

Hello, It seems like this has already been reported and there's a pull request here: #3186
trss commented 2020-06-02 06:12:04 +00:00 (Migrated from github.com)

Somehow missed that, my bad.

Somehow missed that, my bad.
ocornut commented 2020-06-02 15:28:02 +00:00 (Migrated from github.com)

No worries! I'll close this and will aim to look at and merge #3186 soonish.

No worries! I'll close this and will aim to look at and merge #3186 soonish.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#3270
No description provided.