提交 4f25ce81 编写于 作者: L lang

Try to support node

上级 a7df5eba
......@@ -5,11 +5,11 @@
define(function (require) {
var UNDEFINED = 'undefined';
var global = window;
var Float64Array = typeof global.Float64Array === UNDEFINED
? Array : global.Float64Array;
var Int32Array = typeof global.Int32Array === UNDEFINED
? Array : global.Int32Array;
var globalObj = typeof window === 'undefined' ? global : window;
var Float64Array = typeof globalObj.Float64Array === UNDEFINED
? Array : globalObj.Float64Array;
var Int32Array = typeof globalObj.Int32Array === UNDEFINED
? Array : globalObj.Int32Array;
var dataCtors = {
'float': Float64Array,
......
......@@ -250,7 +250,14 @@ define(function (require) {
backgroundColor = 'transparent';
}
}
backgroundColor && (this._dom.style.backgroundColor = backgroundColor);
if (env.node) {
this._zr.configLayer(0, {
clearColor: backgroundColor
});
}
else {
backgroundColor && (this._dom.style.backgroundColor = backgroundColor);
}
console.time && console.timeEnd('update');
},
......
define(function () {
var platform = navigator.platform || '';
var platform = '';
// Navigator not exists in node
if (typeof navigator !== 'undefined') {
platform = navigator.platform || '';
}
return {
// 全图默认背景
backgroundColor: 'rgba(0,0,0,0)',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册