-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add TextBox background #118
Comments
I guess this will need some magic if drawing a rectangle before anything else isn't desirable. For my reference, there are three or four tasks here:
|
It might even need some tweaks to the text rendering API. There is no requirement for text renderers to support character backgrounds and without this it won't be possible to render the background without overdraw. But at the moment there is no way for e-t to detect if the renderer supports character backgrounds, so that it cannot fall back to simply drawing a background rectangle first in these cases. Possible solutions would be:
|
That's inconvenient. e-t would love to have this as a requirement, I think. Silently ignoring some of the otherwise supported ansi sequences is certainly not an ideal end result. |
I'm not sure if I want to make this a requirement. I don't think that, for example, |
I think can understand why, but to be fair, it's a lot simpler to decide between "just drawing a rectangle" vs drawing the background in a more sophisticated way in the font renderers. To be fair, I'm not sure |
Are we talking about character backgrounds or box backgrounds in this case? I wouldn't expect e-t to try to emulate character backgrounds for a text renderer that doesn't support this feature. And box backgrounds can easily be handled by e-t, if it's able to detect that the renderer doesn't support character backgrounds. If a text renderer doesn't support character backgrounds in normal
I already used it once ;), but probably won't use this combination ever again. But there might be other crates in the future that also use the text rendering API that could benefit from any issues we identify and fix now. |
I think box? I'm not sure we want to go down the rabbit hole of actual character bounds.
This is true enough - drawing a rectangle isn't a big deal by itself. But we have multiple options: Either the font renderers draw a background, or
Users may not be aware right away what the font renderes can or cannot do. A |
OK, I'll return to my evil plan of removing all code from e-t and will implement background colors for all renderers. |
I came looking for this same feature, because I had this exact problem. With left aligned text I could work around it by figuring out where the text ends after it is drawn and then drawing the rest of the background separately. But with centered text this is harder. I was hoping the the background color could be extended to the full size of the bounding rectangle. |
Currently e-t doesn't support a background color setting for the entire text box. Having this feature would be useful if you want to dynamically update the content of a text box. Otherwise you need to clear the text box region before redrawing the text box to make sure none of the previous content remains. This can lead to a flickering display, if it is updated directly and doesn't use a framebuffer with explicit flushing.
The text was updated successfully, but these errors were encountered: