@@ -14,15 +14,23 @@ var linkTraces = require('../scatter/link_traces');
14
14
15
15
var styleTextSelection = require ( './edit_style' ) . styleTextSelection ;
16
16
17
- function getViewport ( fullLayout , xaxis , yaxis ) {
17
+
18
+ function getViewport ( fullLayout , xaxis , yaxis , plotGlPixelRatio ) {
18
19
var gs = fullLayout . _size ;
19
- var width = fullLayout . width ;
20
- var height = fullLayout . height ;
20
+ var width = fullLayout . width * plotGlPixelRatio ;
21
+ var height = fullLayout . height * plotGlPixelRatio ;
22
+
23
+ var l = gs . l * plotGlPixelRatio ;
24
+ var b = gs . b * plotGlPixelRatio ;
25
+ var r = gs . r * plotGlPixelRatio ;
26
+ var t = gs . t * plotGlPixelRatio ;
27
+ var w = gs . w * plotGlPixelRatio ;
28
+ var h = gs . h * plotGlPixelRatio ;
21
29
return [
22
- gs . l + xaxis . domain [ 0 ] * gs . w ,
23
- gs . b + yaxis . domain [ 0 ] * gs . h ,
24
- ( width - gs . r ) - ( 1 - xaxis . domain [ 1 ] ) * gs . w ,
25
- ( height - gs . t ) - ( 1 - yaxis . domain [ 1 ] ) * gs . h
30
+ l + xaxis . domain [ 0 ] * w ,
31
+ b + yaxis . domain [ 0 ] * h ,
32
+ ( width - r ) - ( 1 - xaxis . domain [ 1 ] ) * w ,
33
+ ( height - t ) - ( 1 - yaxis . domain [ 1 ] ) * h
26
34
] ;
27
35
}
28
36
@@ -59,7 +67,7 @@ module.exports = function plot(gd, subplot, cdata) {
59
67
scene . line2d = createLine ( regl ) ;
60
68
}
61
69
if ( scene . scatter2d === true ) {
62
- scene . scatter2d = createScatter ( regl , { constPointSize : true } ) ;
70
+ scene . scatter2d = createScatter ( regl ) ;
63
71
}
64
72
if ( scene . fill2d === true ) {
65
73
scene . fill2d = createLine ( regl ) ;
@@ -330,7 +338,7 @@ module.exports = function plot(gd, subplot, cdata) {
330
338
331
339
// provide viewport and range
332
340
var vpRange0 = {
333
- viewport : getViewport ( fullLayout , xaxis , yaxis ) ,
341
+ viewport : getViewport ( fullLayout , xaxis , yaxis , gd . _context . plotGlPixelRatio ) ,
334
342
// TODO do we need those fallbacks?
335
343
range : [
336
344
( xaxis . _rl || xaxis . range ) [ 0 ] ,
0 commit comments