Skip to content

Commit f22fa86

Browse files
josephperrottjelbourn
authored andcommitted
fix(progress-circle): support IE11 (#375)
Completely changes the rendering to use a technique supported in IE11. Fixes #295
1 parent 713b79c commit f22fa86

File tree

3 files changed

+222
-72
lines changed

3 files changed

+222
-72
lines changed

src/components/progress-circle/progress-circle.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
-->
66
<svg viewBox="0 0 100 100"
77
preserveAspectRatio="xMidYMid meet">
8-
<circle [style.strokeDashoffset]="strokeDashOffset()"
9-
cx="50px" cy="50px" r="40px"></circle>
8+
<path [attr.d]="currentPath"></path>
109
</svg>

src/components/progress-circle/progress-circle.scss

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44

55
/* Animation Durations */
66
$md-progress-circle-duration : 5.25s !default;
7-
$md-progress-circle-value-change-duration : $md-progress-circle-duration * 0.25 !default;
87
$md-progress-circle-constant-rotate-duration : $md-progress-circle-duration * 0.55 !default;
98
$md-progress-circle-sporadic-rotate-duration : $md-progress-circle-duration !default;
109

1110
/** Component sizing */
1211
$md-progress-circle-stroke-width: 10px !default;
13-
$md-progress-circle-radius: 40px !default;
14-
$md-progress-circle-circumference: $pi * $md-progress-circle-radius * 2 !default;
1512
// Height and weight of the viewport for md-progress-circle.
1613
$md-progress-circle-viewport-size : 100px !default;
1714

@@ -24,53 +21,33 @@ $md-progress-circle-viewport-size : 100px !default;
2421
width: $md-progress-circle-viewport-size;
2522

2623
/** SVG's viewBox is defined as 0 0 100 100, this means that all SVG children will placed
27-
based on a 100px by 100px box.
28-
29-
The SVG and Circle dimensions/location:
30-
SVG
31-
Height: 100px
32-
Width: 100px
33-
Circle
34-
Radius: 40px
35-
Circumference: 251.3274px
36-
Center x: 50px
37-
Center y: 50px
24+
based on a 100px by 100px box. Additionally all SVG sizes and locations are in reference to
25+
this viewBox.
3826
*/
3927
svg {
4028
height: 100%;
4129
width: 100%;
42-
transform: rotate(-90deg);
4330
transform-origin: center;
4431
}
4532

4633

47-
circle {
34+
path {
4835
fill: transparent;
4936
stroke: md-color($md-primary, 600);
5037
/** Stroke width of 10px defines stroke as 10% of the viewBox */
5138
stroke-width: $md-progress-circle-stroke-width;
52-
/** SVG circle rotations begin rotated 90deg clockwise from the circle's center top */
53-
transition: stroke-dashoffset 0.225s linear;
54-
/** The dash array of the circle is defined as the circumference of the circle. */
55-
stroke-dasharray: $md-progress-circle-circumference;
56-
/** The stroke dashoffset is used to "fill" the circle, 0px represents an full circle,
57-
while the circles full circumference represents an empty circle. */
58-
stroke-dashoffset: 0px;
5939
}
6040

61-
62-
&[color="accent"] circle {
41+
&[color="accent"] path {
6342
stroke: md-color($md-accent, 600);
6443
}
6544

6645

67-
&[color="warn"] circle {
46+
&[color="warn"] path {
6847
stroke: md-color($md-warn, 600);
6948
}
7049

7150

72-
73-
7451
&[mode="indeterminate"] {
7552
animation-duration: $md-progress-circle-sporadic-rotate-duration,
7653
$md-progress-circle-constant-rotate-duration;
@@ -80,14 +57,6 @@ $md-progress-circle-viewport-size : 100px !default;
8057
linear;
8158
animation-iteration-count: infinite;
8259
transition: none;
83-
84-
circle {
85-
animation-duration: $md-progress-circle-value-change-duration;
86-
animation-name: md-progress-circle-value-change;
87-
animation-timing-function: $ease-in-out-curve-function;
88-
animation-iteration-count: infinite;
89-
transition: none;
90-
}
9160
}
9261
}
9362

@@ -107,7 +76,3 @@ $md-progress-circle-viewport-size : 100px !default;
10776
87.5% { transform: rotate( 945deg); }
10877
100% { transform: rotate(1080deg); }
10978
}
110-
@keyframes md-progress-circle-value-change {
111-
0% { stroke-dashoffset: 261.3274px; }
112-
100% { stroke-dashoffset: -241.3274px; }
113-
}

0 commit comments

Comments
 (0)