Skip to content
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

Fixed glitches with anti-aliasing on StyleRectFlat borders #35579

Closed

Conversation

pouleyKetchoupp
Copy link
Contributor

This is take 3 for fixing glitches from #35279, as discussed in PR #35520.

When AA for borders is enabled, the inner AA line used to be drawn within the filling rectangle. This changes ensures that it's drawn within the borders, to make the the filling part is not modified.

This helps fixing an extra line that appears in tabs when using AA. It requires adjusting margins when changing the size of AA, but it works without the need for decimal values. It still keeps blurry lines all around borders to make sure AA works with rotations.

AA off:

AA on, before fix:

AA on, with this fix:

When AA for borders is enabled, the inner AA line used to be drawn within the filling rectangle. This changes ensures that it's drawn within the borders, to make the the filling part is not modified.
@akien-mga
Copy link
Member

CC @Zylann

@Zylann
Copy link
Contributor

Zylann commented Jan 26, 2020

Thanks for your work on this. Unfortunately as I said before, I don't think we can do much with such AA technique, there will always be something off.
On your screenshot, I don't really see much difference apart from the thin line. Borders are blurry as you described, and since this PR doesn't allow decimals I'm not sure I could make them solid. Also because they are blurry, the thin line adjustment makes vertical borders bleed a bit through the panel. Or is it just the numbers you chose?

So with this accounted for, so far the best PR was the one allowing decimal values. Whille I wasn't happy in having to fiddle with it, I could still get a good result in #35279 (comment).
At the same time I've been considering using textures to get exactly what I want (and render faster), even though it's much more work. Really, I think StyleBoxFlat would otherwise need true AA.

@pouleyKetchoupp
Copy link
Contributor Author

Also because they are blurry, the thin line adjustment makes vertical borders bleed a bit through the panel. Or is it just the numbers you chose?
That's what this change is doing on purpose. It allows the tab to be exactly adjusted to cover the top border from the main panel without having to use decimal values, so the thin line artifact is not present anymore.

If I understand correctly, the blurry lines are not acceptable for you, so for now I'm going to close this PR since it's not solving your issue.

As for other options:

  • True AA is a possibility for 4.0, but not for 3.2, as explained before.
  • Decimal values are still a possibility. We could have it available at least for gdscript, but @akien-mga had concerns with it so it might be too late to go with 3.2. It could be part of the next point release though.

@akien-mga
Copy link
Member

Decimal values are still a possibility. We could have it available at least for gdscript, but @akien-mga had concerns with it so it might be too late to go with 3.2. It could be part of the next point release though.

I don't have strong concerns, I just raised the point that this should be discussed, but if both of you are happy using decimal values as a workaround, that works for me.

But yeah, at this point I'd probably wait for 3.2 to be released first in coming days, and we can integrate the consensual fix/workaround for 3.2.1.

@pouleyKetchoupp pouleyKetchoupp deleted the stylebox-flat-aa-fix branch July 1, 2020 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants