Skip to content

Commit 0f5f581

Browse files
author
Diego Jara
authored
Merge pull request eliep#9 from Loghorn/size-bug
Fix intermittent size issue
2 parents 7f89c66 + 38a5374 commit 0f5f581

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

dist/vue-avatar.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Avatar.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,15 @@ export default {
7878
}
7979
8080
const imgBackgroundAndFontStyle = {
81-
background: `url('${this.src}') no-repeat`,
82-
backgroundSize: `${this.size}px ${this.size}px`,
83-
backgroundOrigin: 'content-box'
81+
background: `transparent url(${this.src}) no-repeat scroll 0% 0% / ${this.size}px ${this.size}px content-box border-box`
8482
}
8583
8684
const initialBackgroundAndFontStyle = {
8785
backgroundColor: this.background,
8886
font: Math.floor(this.size / 2.5) + 'px/100px Helvetica, Arial, sans-serif',
8987
fontWeight: 'bold',
9088
color: this.fontColor,
91-
lineHeight: (this.size + Math.floor(this.size / 20)) + 'px'
89+
lineHeight: `${(this.size + Math.floor(this.size / 20))}px`
9290
}
9391
9492
const backgroundAndFontStyle = (this.isImage)

0 commit comments

Comments
 (0)