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
Expose truncated state of SpriteText
#5636
Conversation
Looks fine, but going to wait on a second opinion. @Joehuu for the osu! side implementation, i'd not call |
I worry that this is going to become a case of "change every text in the game to an |
That's precisely why I proposed sealing the class and not calling the base method – it would maintain the correct optimisation in all usages if done that way. |
This won't be applied to every text. The osu!-side PR is only changing a subset of them, mostly text that we have no control over (usernames, beatmap metadata, and skin names). |
2e47670
to
dd8c362
Compare
I don't see any harm in getting this in, regardless of whether we are using it or not. Could probably do with test coverage but honestly truncation doesn't have any yet and it's worked okay, so it can come later if ever. |
SpriteText
Use case is in ppy/osu@master...Joehuu:osu:truncating-text-tooltips.
The way around the overhead is to limit it to
Truncate = true
cases + overridingHandlePositionalInput
to check when an ellipsis is added. Can't really override that on baseSpriteText
as it'll affect other inherited classes likeDrawableDate
.