Skip to content

support fully rounded corner radius - #5839

Merged
andydotxyz merged 7 commits into
fyne-io:developfrom
Vinci10:fully_rounded_corner_radius
Sep 10, 2025
Merged

support fully rounded corner radius#5839
andydotxyz merged 7 commits into
fyne-io:developfrom
Vinci10:fully_rounded_corner_radius

Conversation

@Vinci10

@Vinci10 Vinci10 commented Jul 4, 2025

Copy link
Copy Markdown
Contributor

Description:

(Based on #5830)
Added a new constant FullyRoundedCornerRadius for pill/circular shapes as per Material Design.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.
  • Any breaking changes have a deprecation path or have been discussed.
  • Check for binary size increases when importing new modules.

@andydotxyz

Copy link
Copy Markdown
Member

I don't understand this API sorry. I think it's the same as setting the radius on a rectangle to be half the width or height.
Is that right or is it something different?

@coveralls

coveralls commented Jul 4, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 62.284% (-0.04%) from 62.327%
when pulling bdeae56 on Vinci10:fully_rounded_corner_radius
into 37cb543 on fyne-io:develop.

@Vinci10

Vinci10 commented Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

Right, the API is essentially the same as setting the radius on a rectangle to be half the width or height. Originally, this approach was reserved for circles, but I wanted to extend similar functionality to rectangles as well.
Developers can simply implement this logic on their side, but if the size of the shape changes, the radius would also need to be adjusted accordingly. By handling this directly within the painter, where the size is known before drawing, it simplify the development process and reduce the need for repetitive calculations.

@andydotxyz

Copy link
Copy Markdown
Member

but if the size of the shape changes, the radius would also need to be adjusted accordingly

Thanks, this makes sense as a use-case.

Essentially this could be called RadiusMaximum to avoid having to learn what "fully rounded" means then?

p.s. it would need to be added into the software painter as well - in this case it should be straight forward.

@Vinci10

Vinci10 commented Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

but if the size of the shape changes, the radius would also need to be adjusted accordingly

Thanks, this makes sense as a use-case.

Essentially this could be called RadiusMaximum to avoid having to learn what "fully rounded" means then?

p.s. it would need to be added into the software painter as well - in this case it should be straight forward.

Great! I will update the PR, should I also add some unit tests ?

@andydotxyz

Copy link
Copy Markdown
Member

should I also add some unit tests ?

Yes please - always (unless not possible)

@Vinci10

Vinci10 commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

I added RadiusMaximum to software painter and included tests.

@Vinci10
Vinci10 marked this pull request as ready for review July 16, 2025 10:10
Comment thread canvas.go Outdated
@Vinci10 Vinci10 mentioned this pull request Aug 1, 2025
2 tasks
@dweymouth dweymouth added this to the Glenlivet milestone Sep 5, 2025
@Vinci10 Vinci10 mentioned this pull request Sep 9, 2025
6 tasks

@andydotxyz andydotxyz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice one, thanks for this!

@andydotxyz
andydotxyz merged commit 709b14f into fyne-io:develop Sep 10, 2025
21 of 23 checks passed
@Vinci10
Vinci10 deleted the fully_rounded_corner_radius branch September 16, 2025 21:30
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.

4 participants