bug(mat-progress-spinner): stroke-width of svg circle not calculated properly for some diameter + strokeWidth values
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
The `circle` element of the `mat-progress-spinner`'s SVG does not fill up to the whole space of it's container. This only occurs for some combinations of `strokeWidth` and `diameter` inputs and only if the `stokeWidth` is smaller than 10.
E.g. for the values of `diameter=10` and `strokeWidth=5` the circle's `stroke-width` style is calculated to be `20.8333%` which is not filling up to the edge of the SVG container:

If the value of the circle's `stroke-width` is manually set to ~26%, it fits:

### Reproduction
[StackBlitz link](https://stackblitz.com/edit/cxwm1t?file=src%2Fexample%2Fprogress-spinner-configurable-example.html,src%2Fexample%2Fprogress-spinner-configurable-example.html)
Steps to reproduce:
1. Use mat-progress-spinner
2. Set strokeWidth to value < 10
3. Set diameter to e.g. 24
### Expected Behavior
The SVG's `circle` element should fill up the whole space of its container element
### Actual Behavior
The SVG's `circle` element does not fill up the whole space of its container element and leaves some space in between
### Environment
- Angular: 17.0.7
- CDK/Material: 17.0.4
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’implementazione di mat-progress-spinner e riproduci il problema utilizzando lo StackBlitz collegato, variando diameter e strokeWidth al di sotto di 10. Confronta lo stroke-width calcolato del cerchio SVG con i limiti del contenitore per i valori riportati, quindi verifica che il cerchio riempia il contenitore senza lasciare uno spazio vuoto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100