Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit 2ba52cb

Browse files
committed
Add support for padding on <img>
Fixes #76
1 parent a3f55be commit 2ba52cb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ function fixOne(el) {
118118
el.style.backgroundImage = `url("${(ofi.img.currentSrc || ofi.img.src).replace(/"/g, '\\"')}")`;
119119
el.style.backgroundPosition = style['object-position'] || 'center';
120120
el.style.backgroundRepeat = 'no-repeat';
121+
el.style.backgroundOrigin = 'content-box';
121122

122123
if (/scale-down/.test(style['object-fit'])) {
123124
onImageReady(ofi.img, () => {

0 commit comments

Comments
 (0)