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

Merge remote-tracking branch 'sole/dev-build-python-less-than-2.7' into dev

......@@ -29,6 +29,8 @@ THREE.CanvasRenderer = function ( parameters ) {
_contextLineWidth = null,
_contextLineCap = null,
_contextLineJoin = null,
_contextDashSize = null,
_contextGapSize = 0,
_v1, _v2, _v3, _v4,
_v5 = new THREE.RenderableVertex(),
......@@ -89,6 +91,21 @@ THREE.CanvasRenderer = function ( parameters ) {
_gradientMapQuality --; // Fix UVs
// dash+gap fallbacks for Firefox and everything else
if( ! _context.setLineDash ) {
if( 'mozDash' in _context ) {
_context.setLineDash = function( values ) {
if( values[0] == null || values[1] == null) {
_context.mozDash = null;
} else {
_context.mozDash = values;
}
}
} else {
_context.setLineDash = function( values ) {}
}
}
this.domElement = _canvas;
this.devicePixelRatio = parameters.devicePixelRatio !== undefined
......@@ -573,6 +590,18 @@ THREE.CanvasRenderer = function ( parameters ) {
setLineCap( material.linecap );
setLineJoin( material.linejoin );
setStrokeStyle( material.color.getStyle() );
setDashAndGap( null, null );
_context.stroke();
_elemBox.expandByScalar( material.linewidth * 2 );
} else if ( material instanceof THREE.LineDashedMaterial ) {
setLineWidth( material.linewidth );
setLineCap( material.linecap );
setLineJoin( material.linejoin );
setStrokeStyle( material.color.getStyle() );
setDashAndGap( material.dashSize, material.gapSize );
_context.stroke();
_elemBox.expandByScalar( material.linewidth * 2 );
......@@ -1260,4 +1289,16 @@ THREE.CanvasRenderer = function ( parameters ) {
}
function setDashAndGap( dashSizeValue, gapSizeValue ) {
if( _contextDashSize !== dashSizeValue || _contextGapSize !== gapSizeValue ) {
_context.setLineDash([ dashSizeValue, gapSizeValue ]);
_contextDashSize = dashSizeValue;
_contextGapSize = gapSizeValue;
}
}
};
#!/usr/bin/env python
import sys
if sys.version_info < (2, 7):
print("ERROR: The build script requires Python 2.7 or higher.")
print("You can get an updated version here: http://www.python.org/download/releases/")
exit()
import argparse
import json
import os
import shutil
import sys
import tempfile
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册