Skip to content

Conversation

@myers
Copy link
Collaborator

@myers myers commented Oct 28, 2025

Hello! 您好

I ran into this while attempting to create a slider component.

This PR fixes RenderCircle to automatically set its size (width/height) to the diameter (radius * 2) when the radius property is set, ensuring the bounding box is correct and consistent with RenderRect and RenderRRect.

Changes:

  • RenderCircle.handleRadiusChange(): automatically sets size to diameter when radius is set, or to 0x0 when radius is 0
  • Updated render-circle.stories.tsx to use radius API instead of manually setting width/height

Benefits:

  • Bounding box now correctly matches the visual circle size
  • Consistent behavior with other shape components (Rect, RRect)
  • Simplifies usage - users only need to set radius, not width/height

Make RenderCircle automatically set its size (width/height) to the diameter
(radius * 2) when the radius property is set, ensuring the bounding box is
correct and consistent with RenderRect and RenderRRect.

Changes:
- RenderCircle.handleRadiusChange(): automatically sets size to diameter
  when radius is set, or to 0x0 when radius is 0
- Updated render-circle.stories.tsx to use radius API instead of manually
  setting width/height

Benefits:
- Bounding box now correctly matches the visual circle size
- Consistent behavior with other shape components (Rect, RRect)
- Simplifies usage - users only need to set radius, not width/height
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.

1 participant