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

RichTextLabel clipping ignores rotation. #23233

Closed
Tracked by #39144
Jubjub opened this issue Oct 22, 2018 · 7 comments
Closed
Tracked by #39144

RichTextLabel clipping ignores rotation. #23233

Jubjub opened this issue Oct 22, 2018 · 7 comments

Comments

@Jubjub
Copy link

Jubjub commented Oct 22, 2018

Godot version:
b77a411 (latest master)

Issue description:
When the text overflows in a rotated RichTextLabel, it gets clipped to an axis-aligned rect instead of a rotated rectangle.

Steps to reproduce:
Create RichTextLabel with enough text that it overflows, and rotate it, or its parent.

screenshot from 2018-10-22 22-36-10

@toger5
Copy link
Contributor

toger5 commented Oct 22, 2018

It si weired how the clipping works though... seems strange, that only the bottom left corner is clipped without rotation. Clipping box might be bigger...
I did changes to clipping, so i should look at it. Didn't think about rotation back than. The issue i fixed was about rendering viewports to textures.

@Jubjub
Copy link
Author

Jubjub commented Oct 22, 2018

Thanks for taking a look.
Actually if you rotate it around you'll see that the clipping box is something like this:
image

I tried to fix it myself but only got as far as seeing that the clipping rect is set in https://github.com/godotengine/godot/blob/master/scene/gui/control.cpp#L605 but I'm not familiar enough with the internals to know how to apply the control's rotation to that.

Maybe it's because it uses a glScissor in the driver, and that isnt affected by transforms? Not sure.

@toger5
Copy link
Contributor

toger5 commented Oct 23, 2018

Yea i think the glScissors is the issue. As u said, somewhere in the drivers/visual server file (there are two one for gles2 and one for gles3)
Don't know if the clipping can be applied before the transform?

@Jubjub
Copy link
Author

Jubjub commented Oct 23, 2018

I was researching this last night, but as far as I can see the glScissor test is just a viewport thing that can't have transforms applied to it. One way to solve it would be to check for rotation, and then use a stencil test instead, which can be any arbitrary shape.

@KoBeWi
Copy link
Member

KoBeWi commented Apr 18, 2019

Related: #20671

@KoBeWi
Copy link
Member

KoBeWi commented Nov 13, 2020

Still valid in a6d4484

@Calinou
Copy link
Member

Calinou commented Aug 5, 2022

Duplicate of #20671.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants