Skip to content

Commit 70f242b

Browse files
committed
2.0.6
1 parent a270ef7 commit 70f242b

13 files changed

+107
-47
lines changed

dist/danmaku.canvas.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
return 'transform';
2626
}());
2727

28-
const dpr = window.devicePixelRatio || 1;
28+
var dpr = typeof window !== 'undefined' && window.devicePixelRatio || 1;
2929

3030
var canvasHeightCache = Object.create(null);
3131

@@ -280,17 +280,27 @@
280280
}
281281

282282
var raf =
283-
window.requestAnimationFrame ||
284-
window.mozRequestAnimationFrame ||
285-
window.webkitRequestAnimationFrame ||
283+
(
284+
typeof window !== 'undefined' &&
285+
(
286+
window.requestAnimationFrame ||
287+
window.mozRequestAnimationFrame ||
288+
window.webkitRequestAnimationFrame
289+
)
290+
) ||
286291
function(cb) {
287292
return setTimeout(cb, 50 / 3);
288293
};
289294

290295
var caf =
291-
window.cancelAnimationFrame ||
292-
window.mozCancelAnimationFrame ||
293-
window.webkitCancelAnimationFrame ||
296+
(
297+
typeof window !== 'undefined' &&
298+
(
299+
window.cancelAnimationFrame ||
300+
window.mozCancelAnimationFrame ||
301+
window.webkitCancelAnimationFrame
302+
)
303+
) ||
294304
clearTimeout;
295305

296306
function binsearch(arr, prop, key) {

dist/danmaku.canvas.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.

dist/danmaku.dom.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,27 @@
225225
}
226226

227227
var raf =
228-
window.requestAnimationFrame ||
229-
window.mozRequestAnimationFrame ||
230-
window.webkitRequestAnimationFrame ||
228+
(
229+
typeof window !== 'undefined' &&
230+
(
231+
window.requestAnimationFrame ||
232+
window.mozRequestAnimationFrame ||
233+
window.webkitRequestAnimationFrame
234+
)
235+
) ||
231236
function(cb) {
232237
return setTimeout(cb, 50 / 3);
233238
};
234239

235240
var caf =
236-
window.cancelAnimationFrame ||
237-
window.mozCancelAnimationFrame ||
238-
window.webkitCancelAnimationFrame ||
241+
(
242+
typeof window !== 'undefined' &&
243+
(
244+
window.cancelAnimationFrame ||
245+
window.mozCancelAnimationFrame ||
246+
window.webkitCancelAnimationFrame
247+
)
248+
) ||
239249
clearTimeout;
240250

241251
function binsearch(arr, prop, key) {

dist/danmaku.dom.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.

dist/danmaku.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
remove: remove,
111111
};
112112

113-
const dpr = window.devicePixelRatio || 1;
113+
var dpr = typeof window !== 'undefined' && window.devicePixelRatio || 1;
114114

115115
var canvasHeightCache = Object.create(null);
116116

@@ -365,17 +365,27 @@
365365
}
366366

367367
var raf =
368-
window.requestAnimationFrame ||
369-
window.mozRequestAnimationFrame ||
370-
window.webkitRequestAnimationFrame ||
368+
(
369+
typeof window !== 'undefined' &&
370+
(
371+
window.requestAnimationFrame ||
372+
window.mozRequestAnimationFrame ||
373+
window.webkitRequestAnimationFrame
374+
)
375+
) ||
371376
function(cb) {
372377
return setTimeout(cb, 50 / 3);
373378
};
374379

375380
var caf =
376-
window.cancelAnimationFrame ||
377-
window.mozCancelAnimationFrame ||
378-
window.webkitCancelAnimationFrame ||
381+
(
382+
typeof window !== 'undefined' &&
383+
(
384+
window.cancelAnimationFrame ||
385+
window.mozCancelAnimationFrame ||
386+
window.webkitCancelAnimationFrame
387+
)
388+
) ||
379389
clearTimeout;
380390

381391
function binsearch(arr, prop, key) {

0 commit comments

Comments
 (0)