提交 b507048f 编写于 作者: M Mr.doob

SVGRenderer: Implemented @srifqi clearAlpha code. Fixes #4898.

上级 c0aaebaa
......@@ -23,6 +23,7 @@ THREE.SVGRenderer = function () {
_directionalLights = new THREE.Color(),
_pointLights = new THREE.Color(),
_clearColor = new THREE.Color(),
_clearAlpha = 1,
_w, // z-buffer to w-buffer
_vector3 = new THREE.Vector3(), // Needed for PointLight
......@@ -67,7 +68,8 @@ THREE.SVGRenderer = function () {
this.setClearColor = function ( color, alpha ) {
_clearColor.set(color);
_clearColor.set( color );
_clearAlpha = alpha !== undefined ? alpha : 1;
};
......@@ -97,7 +99,7 @@ THREE.SVGRenderer = function () {
}
_svg.style.backgroundColor = _clearColor.getStyle();
_svg.style.backgroundColor = 'rgba(' + ( ( _clearColor.r * 255 ) | 0 ) + ',' + ( ( _clearColor.g * 255 ) | 0 ) + ',' + ( ( _clearColor.b * 255 ) | 0 ) + ',' + _clearAlpha + ')';
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册