fix round avatars with border top and bottom width

pull/1344/head
Audric Ackermann 5 years ago
parent be35770517
commit f11cb7744d
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -46,8 +46,10 @@ export class AvatarPlaceHolder extends React.PureComponent<Props, State> {
public render() { public render() {
const { borderColor, colors, diameter, name } = this.props; const { borderColor, colors, diameter, name } = this.props;
const diameterWithoutBorder = diameter - 2;
const viewBox = `0 0 ${diameter} ${diameter}`; const viewBox = `0 0 ${diameter} ${diameter}`;
const r = diameter / 2; const r = diameter / 2;
const rWithoutBorder = diameterWithoutBorder / 2;
if (!this.state.sha512Seed) { if (!this.state.sha512Seed) {
// return grey circle // return grey circle
@ -57,7 +59,7 @@ export class AvatarPlaceHolder extends React.PureComponent<Props, State> {
<circle <circle
cx={r} cx={r}
cy={r} cy={r}
r={r} r={rWithoutBorder}
fill="#d2d2d3" fill="#d2d2d3"
shape-rendering="geometricPrecision" shape-rendering="geometricPrecision"
stroke={borderColor} stroke={borderColor}
@ -84,7 +86,7 @@ export class AvatarPlaceHolder extends React.PureComponent<Props, State> {
<circle <circle
cx={r} cx={r}
cy={r} cy={r}
r={r} r={rWithoutBorder}
fill={bgColor} fill={bgColor}
shape-rendering="geometricPrecision" shape-rendering="geometricPrecision"
stroke={borderColor} stroke={borderColor}

Loading…
Cancel
Save