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

Custom border width in Image() #8131

Open
wants to merge 1 commit into
base: docking
Choose a base branch
from
Open

Conversation

micb25
Copy link
Contributor

@micb25 micb25 commented Nov 5, 2024

This PR introduces the possibility to specify a custom border width in Image() by adding an additional parameter border_width. There is currently no way to adjust the width of a drawn image border as it is hard-coded to 1 pixel, which may be insufficient for high DPI displays.

@ocornut ocornut added the style label Nov 6, 2024
@ocornut
Copy link
Owner

ocornut commented Nov 6, 2024

Hello, thanks for the PR. I might need to put this one on hold for a bit.
It may be better to add a float ImageBorderSize to the style structure.
(I'm not even sure border_col should be an argument to this function tbh)

@micb25
Copy link
Contributor Author

micb25 commented Nov 6, 2024

Thanks, I fully agree.

In the current implementation the border size gets set via the alpha channel of the border color. I think this logic is somewhat inappropriate, because the total image size depends on the alpha channel. E.g., I have a window with several image previews and I want to highlight the active one by drawing an image border, however, this leads to different sizes that can only be fixed by setting a small non-zero alpha channel.

Thus, I would prefer two new styles (border color and border width). What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants