Closed kiith-sa closed 10 years ago
I'd even inject a cast(int)
for both parameters to max
. IIRC max works unexpectedly if one of the arguments is unsigned. I think it ends up casting a signed number to unsigned, leading to massively huge numbers.
Both parameters to the max
calls are ints (1
, width
, SCROLL_AREA_PADDING
, height
, AREA_HEADER
are all ints) - I don't see a need to add a cast.
Thanks again for the work.
As the size of a scissor rectangle used in ScrollArea is defined as (width - something, height - something), the rectangle would have negative size if e.g. the scissor area size is proportional to window size and the window gets resized to a small size. This would result in a segfault (at least on AMD Catalyst/Linux).
E.g. when a user plays around with window width/height the program (even dimgui examples) would crash.
I worked around this by forcing the scissor area to be at least 1x1 pixels large.