-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradient filled rectangle not rounding #6652
Comments
Your assumption that the bottom left corner is rounding correctly is wrong. You just can't see it since it is a transparent black (alpha 0), not a solid one. So basically, your problem is that you have rather extreme rounding values and rectangular clipping can't accommodate this. Normally rounding is much smaller and a margin ensures that the content doesn't get into those rounded corners. Fixing this the way you want is out of the scope of ImGui, but you can accomplish this if you render into a texture with alpha channel and mask it yourself, then draw that texture as an image. |
It’s also that AddRectFilledMultiColor() doesn’t even support rounding. In the event your shape could fill the window without requiring clipping (which is always rectangular) you could use AddRectFilled() with rounding and white color + the ShadeVertsLinearColorGradientKeepAlpha() function. See the code in #4722 |
Thank you very much! |
Imgui Version: 1.89.6
Using the following code to draw a rectangle with a gradient fill in the window:
As you can see, the top left and right corners and the bottom left corners round the corners correctly.
The lower right corner of the rectangle a gradient fill is not cut and it "climbs out".
Is this the correct behavior of Imgui ? Is that how it should be?
The text was updated successfully, but these errors were encountered: