@@ -1187,7 +1187,7 @@ export class StyleUtils {
1187
1187
strokeColorArray && strokeColorArray . push ( strokeOpacity ) ;
1188
1188
var stroke = new Style ( {
1189
1189
stroke : new StrokeStyle ( {
1190
- width : strokeWidth ,
1190
+ width : strokeWidth || ZERO ,
1191
1191
color : strokeColorArray ,
1192
1192
lineCap : lineCap || 'round' ,
1193
1193
lineDash : [ 0 ]
@@ -1198,9 +1198,10 @@ export class StyleUtils {
1198
1198
let outlineColorArray = this . hexToRgb ( outlineColor ) ;
1199
1199
// opacity使用style的透明度。保持两根线透明度一致
1200
1200
outlineColorArray && outlineColorArray . push ( strokeOpacity ) ;
1201
+ let outlineWidth = strokeWidth === 0 ? ZERO : strokeWidth + 2 ; //外部宽度=内部样式宽度 + 2
1201
1202
var outlineStroke = new Style ( {
1202
1203
stroke : new StrokeStyle ( {
1203
- width : strokeWidth + 2 , //外部宽度=内部样式宽度 + 2
1204
+ width : outlineWidth , //外部宽度=内部样式宽度 + 2
1204
1205
color : outlineColorArray ,
1205
1206
lineCap : lineCap || 'round' ,
1206
1207
lineDash : [ 0 ]
@@ -1222,7 +1223,7 @@ export class StyleUtils {
1222
1223
strokeColorArray && strokeColorArray . push ( strokeOpacity ) ;
1223
1224
var stroke = new Style ( {
1224
1225
stroke : new StrokeStyle ( {
1225
- width : strokeWidth ,
1226
+ width : strokeWidth * 0.5 || ZERO ,
1226
1227
color : strokeColorArray ,
1227
1228
lineCap,
1228
1229
lineDash
@@ -1235,11 +1236,9 @@ export class StyleUtils {
1235
1236
outlineColorArray && outlineColorArray . push ( strokeOpacity ) ;
1236
1237
var outlineStroke = new Style ( {
1237
1238
stroke : new StrokeStyle ( {
1238
- width : strokeWidth ,
1239
+ width : strokeWidth || ZERO ,
1239
1240
color : outlineColorArray ,
1240
- lineCap,
1241
- lineDash,
1242
- lineDashOffset : ( lineDash [ 0 ] + lineDash [ 1 ] ) / 2
1241
+ lineCap
1243
1242
} )
1244
1243
} ) ;
1245
1244
return [ outlineStroke , stroke ] ;
0 commit comments