Skip to content

Commit 7288c0c

Browse files
authored
Merge pull request #3 from etpinard/master
Take over changes
2 parents ae7d15f + 23d6aaf commit 7288c0c

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ let shaderCache = new WeakMap
2323

2424
// Safari does not support font-stretch
2525
let isStretchSupported = false
26-
let el = document.body.appendChild(document.createElement('div'))
27-
el.style.font = 'italic small-caps bold condensed 16px/2 cursive'
28-
if (getComputedStyle(el).fontStretch) {
29-
isStretchSupported = true
26+
if (document.body) {
27+
let el = document.body.appendChild(document.createElement('div'))
28+
el.style.font = 'italic small-caps bold condensed 16px/2 cursive'
29+
if (getComputedStyle(el).fontStretch) {
30+
isStretchSupported = true
31+
}
32+
document.body.removeChild(el)
3033
}
31-
document.body.removeChild(el)
3234

3335
class GlText {
3436
constructor (o) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "gl-text",
3-
"version": "1.1.4",
2+
"name": "@etpinard/gl-text",
3+
"version": "1.1.6",
44
"description": "Render text with WebGL",
55
"main": "dist.js",
66
"scripts": {

0 commit comments

Comments
 (0)