@@ -92,18 +92,23 @@ THREE.CanvasRenderer = function ( parameters ) {
92
92
_gradientMapQuality -- ; // Fix UVs
93
93
94
94
// dash+gap fallbacks for Firefox and everything else
95
- if ( ! _context . setLineDash ) {
96
- if ( 'mozDash' in _context ) {
97
- _context . setLineDash = function ( values ) {
98
- if ( values [ 0 ] == null || values [ 1 ] == null ) {
99
- _context . mozDash = null ;
100
- } else {
101
- _context . mozDash = values ;
102
- }
95
+
96
+ if ( _context . setLineDash === undefined ) {
97
+
98
+ if ( _context . mozDash !== undefined ) {
99
+
100
+ _context . setLineDash = function ( values ) {
101
+
102
+ _context . mozDash = values [ 0 ] !== null ? values : null ;
103
+
103
104
}
105
+
104
106
} else {
105
- _context . setLineDash = function ( values ) { }
107
+
108
+ _context . setLineDash = function ( values ) { }
109
+
106
110
}
111
+
107
112
}
108
113
109
114
this . domElement = _canvas ;
@@ -1291,12 +1296,12 @@ THREE.CanvasRenderer = function ( parameters ) {
1291
1296
1292
1297
function setDashAndGap ( dashSizeValue , gapSizeValue ) {
1293
1298
1294
- if ( _contextDashSize !== dashSizeValue || _contextGapSize !== gapSizeValue ) {
1295
-
1296
- _context . setLineDash ( [ dashSizeValue , gapSizeValue ] ) ;
1299
+ if ( _contextDashSize !== dashSizeValue || _contextGapSize !== gapSizeValue ) {
1300
+
1301
+ _context . setLineDash ( [ dashSizeValue , gapSizeValue ] ) ;
1297
1302
_contextDashSize = dashSizeValue ;
1298
1303
_contextGapSize = gapSizeValue ;
1299
-
1304
+
1300
1305
}
1301
1306
1302
1307
}
0 commit comments