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

ImageButton ignoring input Image rounding #3486

Closed
v-kat opened this issue Oct 18, 2023 · 4 comments · Fixed by #3531
Closed

ImageButton ignoring input Image rounding #3486

v-kat opened this issue Oct 18, 2023 · 4 comments · Fixed by #3531
Labels
bug Something is broken

Comments

@v-kat
Copy link
Contributor

v-kat commented Oct 18, 2023

ui.add(ImageButton::new(
    egui::Image::new(SizedTexture::new(
        *a_texture_id,
        egui::Vec2::new(1.0, 1.0)
    )).rounding(50.0)
));

https://github.com/emilk/egui/blob/master/crates/egui/src/widgets/button.rs#L620 is the problem line I believe

Expected behavior
The image button should respect the input image's rounding. There should also maybe be an exposed .rounding method on the ImageButton. I might try to fix this later myself....

@v-kat v-kat added the bug Something is broken label Oct 18, 2023
@chriscate
Copy link
Contributor

@v-kat did you end up working on this? I'm looking for ways to get comfortable with contributing to egui and the code base in general. Thinking this bug may be a nice intro if you didn't already take it on.

@v-kat
Copy link
Contributor Author

v-kat commented Nov 4, 2023

I haven't thanks for asking. You can go ahead with it. I also wanted to check on keyboard support for ImageButton and menu_image_button too. #3288 is an example small PR

@chriscate
Copy link
Contributor

great thanks!

@chriscate
Copy link
Contributor

chriscate commented Nov 5, 2023

@v-kat I opened draft PR for this last night (and also added a note/question in there about my current approach). If you get a moment just let me know if there's anything you would change and if not I'll mark it ready for review. I did mention in the PR too that a new rounding() method on the ImageButton itself could be a separate issue/enhancement. Let me know if you disagree though.

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

Successfully merging a pull request may close this issue.

2 participants