Skip to content

Commit 0a75bc8

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent 2bdf97e commit 0a75bc8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ const chart3D = lc
4646
},
4747
theme: (() => {
4848
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
49-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
49+
const smallView = window.devicePixelRatio >= 2
5050
if (!window.__lcjsDebugOverlay) {
5151
window.__lcjsDebugOverlay = document.createElement('div')
5252
window.__lcjsDebugOverlay.style.cssText = 'position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);color:#fff;padding:4px 8px;z-index:99999;font:12px monospace;pointer-events:none'
5353
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
5454
setInterval(() => {
5555
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
56-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
56+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
5757
}, 500)
5858
}
5959
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
6060
})(),
61+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
6162
})
6263
.setTitle('3D view — select a point to update 2D slices')
6364
.setTitleMargin(0)

0 commit comments

Comments
 (0)