未验证 提交 00337d96 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #15922 from BTEVC/dev

SVGLoader: Added fill-opacity style support.
......@@ -99,6 +99,7 @@ THREE.SVGLoader.prototype = {
transformPath( path, currentTransform );
paths.push( path );
path.userData = { node: node, style: style };
}
......@@ -694,6 +695,9 @@ THREE.SVGLoader.prototype = {
if ( node.hasAttribute( 'fill' ) ) style.fill = node.getAttribute( 'fill' );
if ( node.style.fill !== '' ) style.fill = node.style.fill;
if ( node.hasAttribute( 'fill-opacity' ) ) style.fillOpacity = node.getAttribute( 'fill-opacity' );
if ( node.style.fillOpacity !== '' ) style.fillOpacity = node.style.fillOpacity;
return style;
}
......@@ -1012,13 +1016,16 @@ THREE.SVGLoader.prototype = {
console.time( 'THREE.SVGLoader: Parse' );
parseNode( xml.documentElement, { fill: '#000' } );
var data = { paths: paths, xml: xml.documentElement };
// console.log( paths );
console.timeEnd( 'THREE.SVGLoader: Parse' );
return paths;
return data;
}
......
......@@ -149,7 +149,9 @@
//
var loader = new THREE.SVGLoader();
loader.load( url, function ( paths ) {
loader.load( url, function ( data ) {
var paths = data.paths;
var group = new THREE.Group();
group.scale.multiplyScalar( 0.25 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册