Repository navigation
fix(ring): paint rings as outlines, and on WButton at all #239
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
Changes from all commits
8578f20
efea0fe
e718166
927938b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1591,11 +1591,11 @@ class WDiv extends StatelessWidget { | |
| // Merge decoration with shadows (boxShadow + ringShadow) | ||
| BoxDecoration? finalDecoration = styles.decoration; | ||
|
|
||
| // Combine box shadows and ring shadows | ||
| List<BoxShadow>? combinedShadows; | ||
| if (styles.boxShadow != null || styles.ringShadow != null) { | ||
| combinedShadows = [...?styles.boxShadow, ...?styles.ringShadow]; | ||
| } | ||
| // Box shadows only. The ring is an outline painted around the box below | ||
| // (`WindStyle.ringOutline`), never a shadow: a Flutter `BoxShadow` is not clipped | ||
| // to the outside of its box as a browser's box-shadow is, so a ring | ||
| // shadow filled any element without a background with the ring colour. | ||
| final List<BoxShadow>? combinedShadows = styles.boxShadow; | ||
|
|
||
| if (combinedShadows != null && combinedShadows.isNotEmpty) { | ||
| if (finalDecoration == null) { | ||
|
|
@@ -1736,6 +1736,17 @@ class WDiv extends StatelessWidget { | |
| logger: logger, | ||
| ); | ||
| } | ||
|
|
||
| final BoxDecoration? ring = styles.ringOutline; | ||
| if (ring != null) { | ||
| logger.wrapWith("DecoratedBox (Ring)", "${styles.ringWidth}px"); | ||
| WindPerfCounters.recordWrapperEmission('DecoratedBox'); | ||
| widgetToBuild = DecoratedBox( | ||
| position: DecorationPosition.foreground, | ||
| decoration: ring, | ||
| child: widgetToBuild, | ||
|
Comment on lines
+1744
to
+1747
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Paint the ring outside the overflow clip. If a 🤖 Prompt for AI Agents |
||
| ); | ||
| } | ||
| } | ||
|
|
||
| // 1c. EXPLICIT SIZING (w-*, h-* when not handled by overflow) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve the box shape in the ring decoration.
If a
WDivuses an explicitWindStylewithBoxDecoration(shape: BoxShape.circle)and a configured ring,ringOutlinepaints a rectangle around the circular box. Copydecoration?.shapeinto the ring decoration. Flutter usesBoxDecoration.shapeto select the circle or rectangle painted by a border. (api.flutter.dev)🤖 Prompt for AI Agents