浏览代码

Merge pull request #11884 from proteamer/dev

Fixed display dashed lines in SVG renderer #11879
Mr.doob 8 年之前
父节点
当前提交
c63ee06f82
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      examples/js/renderers/SVGRenderer.js

+ 3 - 3
examples/js/renderers/SVGRenderer.js

@@ -382,11 +382,11 @@ THREE.SVGRenderer = function () {
 
 
 			var style = 'fill:none;stroke:' + getSvgColor( material.color, material.opacity ) + ';stroke-width:' + material.linewidth + ';stroke-linecap:' + material.linecap;
 			var style = 'fill:none;stroke:' + getSvgColor( material.color, material.opacity ) + ';stroke-width:' + material.linewidth + ';stroke-linecap:' + material.linecap;
 
 
-			addPath( style, path );
+			if ( material.isLineDashedMaterial ) {
 
 
-		} else if ( material.isLineDashedMaterial ) {
+				style = style + ';stroke-dasharray:' + material.dashSize + "," + material.gapSize;
 
 
-			var style = 'fill:none;stroke:' + getSvgColor( material.color, material.opacity ) + ';stroke-width:' + material.linewidth + ';stroke-dasharray:' + material.dashSize + "," + material.gapSize;
+			}
 
 
 			addPath( style, path );
 			addPath( style, path );