Comments (4)
I think this maybe because https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap
from progress.
Different strokeLinecap has a different start point and end point.
from progress.
Yes, different strokeLinecap has a different start point and end point. And it leads to incorrect calculation of the progress bar length. This is the rendering result in the browser of my example above:
<svg class="rc-progress-line" viewBox="0 0 100 10" preserveAspectRatio="none">
<path class="rc-progress-line-trail"
d="M 5,5 L 95,5" stroke-linecap="round"
stroke="rgba(255,255,255, .4)" stroke-width="10" fill-opacity="0"></path>
<path class="rc-progress-line-path"
d="M 5,5 L 95,5" stroke-linecap="round"
stroke="#FFE68D" stroke-width="10" fill-opacity="0" style="stroke-dasharray: 90px, 100px; stroke-dashoffset: 0px; transition: stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s linear 0s, 0.06s;"></path>
</svg>
The length of rc-progress-line-path
is 90(d="M 5,5 L 95,5"
, 95 - 5), so it will reach full state at stroke-dasharray: 90px, 100px;
.
This bug can fix in two ways:
- svg
viewBox="0 0 ${100 + strokeWidth} 10"
, pathd="M ${strokeWidth / 2},5 L ${100 + strokeWidth / 2},5"
, in this way, path's length is corrected to 100; - Recalculate the length of
rc-progress-line-path
, It should be equal tostroke-dasharray: ${percent * (100 - strokeWidth) / 100 }px, 100px;
from progress.
PR welcome~
from progress.
Related Issues (20)
- 渐变圆不能在渐变行里面用吗
- Option to Add Title and Icon
- [Feature Request] Allow inserting a custom component in the centre of circular progress
- Module not found: Error: Can't resolve 'rc-util/es/Dom/canUseDom' HOT 1
- ChainAlert: new npm maintainer has published version 3.2.4 of package rc-progress HOT 1
- rc progress bar not appearing in the iphone and ipad devices HOT 1
- Gradient for Line component
- New version fills the bar a bit for 0 percentage HOT 1
- Progress bar indefinite mode
- No parameter for adding a border style
- onHover Functionality
- TrailWidth taking default 1, not matching strokeWidth.
- Warning: Circle: Support for defaultProps will be removed from function components in a future major release.
- circle flickers
- scss file
- didn't accept dynamic color value.
- Can we lose the animation for reduced motion setting HOT 1
- Indeterminate Value HOT 7
- missing rc-progress/assets/index.css HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from progress.