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

Per-corner rounding of rectangles #1206

Merged
merged 5 commits into from
Feb 5, 2022
Merged

Per-corner rounding of rectangles #1206

merged 5 commits into from
Feb 5, 2022

Conversation

4JX
Copy link
Contributor

@4JX 4JX commented Feb 4, 2022

Ever got bored of those plain old boring corners? Don't you feel they all look the same? Fear not, I have the solution for you:

Uses a new Rounding struct as discussed on the discord. Although maybe redundant, also gave it a new function to shorten things a bit when creating more complex layouts.

I separated each corner into its own slider for what is shown in the demo app, however I have no idea where the other sliders in WidgetVisuals go to. Oh those are for widgets themselves. Seems the labels fit the style so that's good.

Note: I was not able to run check.sh which seems to have already been reported here. Got a bunch of mismatched type errors.

@4JX
Copy link
Contributor Author

4JX commented Feb 4, 2022

Not too sure of whether the changelog for this would go on either egui/epaint or both given the changes that were made.

@4JX 4JX closed this Feb 4, 2022
@4JX 4JX deleted the individual-corner-radius2 branch February 4, 2022 18:36
@4JX 4JX restored the individual-corner-radius2 branch February 4, 2022 18:36
@4JX 4JX reopened this Feb 4, 2022
@4JX
Copy link
Contributor Author

4JX commented Feb 4, 2022

Whoops. Seems github does dont like renaming branches with open PRs

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, but I left some comments

Comment on lines +385 to +388
pub nw: f32,
pub ne: f32,
pub sw: f32,
pub se: f32,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub nw: f32,
pub ne: f32,
pub sw: f32,
pub se: f32,
/// north-west = left-top
pub nw: f32,
/// north-east = right-top
pub ne: f32,
/// south-west = left-bottom
pub sw: f32,
/// south-east = right-bottom
pub se: f32,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps something like /// Top left (north-west) would be a bit better formatting wise for these?

epaint/src/shape.rs Show resolved Hide resolved
epaint/src/shape.rs Show resolved Hide resolved
epaint/src/shape.rs Outdated Show resolved Hide resolved
epaint/src/shape.rs Show resolved Hide resolved
epaint/src/shape.rs Show resolved Hide resolved
epaint/src/tessellator.rs Show resolved Hide resolved
epaint/src/tessellator.rs Show resolved Hide resolved
4JX and others added 4 commits February 5, 2022 13:32
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spectacular - thanks!

@emilk emilk changed the title Add the ability to adress each corner's radius individually Per-corner rounding of rectangles Feb 5, 2022
@emilk emilk merged commit 7e7b9e1 into emilk:master Feb 5, 2022
emilk added a commit that referenced this pull request Feb 5, 2022
Also update changelogs and clean up other aspects of
#1206
emilk added a commit to emilk/egui_plot that referenced this pull request Jul 15, 2024
Also update changelogs and clean up other aspects of
emilk/egui#1206
Hasenfellvy added a commit to Hasenfellvy/egui_plot that referenced this pull request Aug 27, 2024
Also update changelogs and clean up other aspects of
emilk/egui#1206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants