Skip to content

Commit 408eb17

Browse files
committed
Pick the smallest possible image
1 parent 79dae1b commit 408eb17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web-src/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ for (const b of backgrounds) {
111111
sources = sm.landscape
112112
}
113113

114-
let src
114+
let src = sources[0].filename
115115

116-
for (const s of sources) {
117-
src = s.filename
118-
116+
for (const s of sources.slice(1)) {
119117
if (screenLength <= s.length) {
120118
break
121119
}
120+
121+
src = s.filename
122122
}
123123

124124
img.onload = () => {

0 commit comments

Comments
 (0)