@@ -39,6 +39,8 @@ function convertStyle(gd, trace) {
39
39
textUnsel : undefined
40
40
} ;
41
41
42
+ var plotGlPixelRatio = gd . _context . plotGlPixelRatio ;
43
+
42
44
if ( trace . visible !== true ) return opts ;
43
45
44
46
if ( subTypes . hasText ( trace ) ) {
@@ -64,7 +66,7 @@ function convertStyle(gd, trace) {
64
66
if ( subTypes . hasLines ( trace ) ) {
65
67
opts . line = {
66
68
overlay : true ,
67
- thickness : trace . line . width ,
69
+ thickness : trace . line . width * plotGlPixelRatio ,
68
70
color : trace . line . color ,
69
71
opacity : trace . opacity
70
72
} ;
@@ -77,11 +79,11 @@ function convertStyle(gd, trace) {
77
79
}
78
80
79
81
if ( trace . error_x && trace . error_x . visible ) {
80
- opts . errorX = convertErrorBarStyle ( trace , trace . error_x ) ;
82
+ opts . errorX = convertErrorBarStyle ( trace , trace . error_x , plotGlPixelRatio ) ;
81
83
}
82
84
83
85
if ( trace . error_y && trace . error_y . visible ) {
84
- opts . errorY = convertErrorBarStyle ( trace , trace . error_y ) ;
86
+ opts . errorY = convertErrorBarStyle ( trace , trace . error_y , plotGlPixelRatio ) ;
85
87
}
86
88
87
89
if ( ! ! trace . fill && trace . fill !== 'none' ) {
@@ -106,6 +108,7 @@ function convertTextStyle(gd, trace) {
106
108
var tff = textfontIn . family ;
107
109
var optsOut = { } ;
108
110
var i ;
111
+ var plotGlPixelRatio = gd . _context . plotGlPixelRatio ;
109
112
110
113
var texttemplate = trace . texttemplate ;
111
114
if ( texttemplate ) {
@@ -191,13 +194,13 @@ function convertTextStyle(gd, trace) {
191
194
Array . isArray ( tfs ) ? (
192
195
isNumeric ( tfs [ i ] ) ? tfs [ i ] : 0
193
196
) : tfs
194
- ) ;
197
+ ) * plotGlPixelRatio ;
195
198
196
199
fonti . family = Array . isArray ( tff ) ? tff [ i ] : tff ;
197
200
}
198
201
} else {
199
202
// if both are single values, make render fast single-value
200
- optsOut . font = { size : tfs , family : tff } ;
203
+ optsOut . font = { size : tfs * plotGlPixelRatio , family : tff } ;
201
204
}
202
205
203
206
return optsOut ;
@@ -283,7 +286,8 @@ function convertMarkerStyle(trace) {
283
286
}
284
287
285
288
// prepare sizes
286
- var markerSizeFunc = makeBubbleSizeFn ( trace ) ;
289
+ var sizeFactor = 1 ;
290
+ var markerSizeFunc = makeBubbleSizeFn ( trace , sizeFactor ) ;
287
291
var s ;
288
292
289
293
if ( multiSize || multiLineWidth ) {
@@ -308,10 +312,10 @@ function convertMarkerStyle(trace) {
308
312
// See https://github.com/plotly/plotly.js/pull/1781#discussion_r121820798
309
313
if ( multiLineWidth ) {
310
314
for ( i = 0 ; i < count ; i ++ ) {
311
- borderSizes [ i ] = optsIn . line . width [ i ] / 2 ;
315
+ borderSizes [ i ] = optsIn . line . width [ i ] ;
312
316
}
313
317
} else {
314
- s = optsIn . line . width / 2 ;
318
+ s = optsIn . line . width ;
315
319
for ( i = 0 ; i < count ; i ++ ) {
316
320
borderSizes [ i ] = s ;
317
321
}
@@ -335,7 +339,7 @@ function convertMarkerSelection(trace, target) {
335
339
if ( target . marker && target . marker . symbol ) {
336
340
optsOut = convertMarkerStyle ( Lib . extendFlat ( { } , optsIn , target . marker ) ) ;
337
341
} else if ( target . marker ) {
338
- if ( target . marker . size ) optsOut . size = target . marker . size / 2 ;
342
+ if ( target . marker . size ) optsOut . size = target . marker . size ;
339
343
if ( target . marker . color ) optsOut . colors = target . marker . color ;
340
344
if ( target . marker . opacity !== undefined ) optsOut . opacity = target . marker . opacity ;
341
345
}
@@ -365,10 +369,10 @@ function convertTextSelection(gd, trace, target) {
365
369
return optsOut ;
366
370
}
367
371
368
- function convertErrorBarStyle ( trace , target ) {
372
+ function convertErrorBarStyle ( trace , target , plotGlPixelRatio ) {
369
373
var optsOut = {
370
- capSize : target . width * 2 ,
371
- lineWidth : target . thickness ,
374
+ capSize : target . width * 2 * plotGlPixelRatio ,
375
+ lineWidth : target . thickness * plotGlPixelRatio ,
372
376
color : target . color
373
377
} ;
374
378
0 commit comments