Skip to content

Commit f6d2ddc

Browse files
authored
Merge pull request #735 from plotly/non-blurry-gl2d-img
Make gl2d snapshot non-blurry
2 parents 624b64f + b0ecf2e commit f6d2ddc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/plots/gl2d/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
8686

8787
exports.toSVG = function(gd) {
8888
var fullLayout = gd._fullLayout,
89-
subplotIds = Plots.getSubplotIds(fullLayout, 'gl2d'),
90-
size = fullLayout._size;
89+
subplotIds = Plots.getSubplotIds(fullLayout, 'gl2d');
9190

9291
for(var i = 0; i < subplotIds.length; i++) {
9392
var subplot = fullLayout._plots[subplotIds[i]],
@@ -99,10 +98,10 @@ exports.toSVG = function(gd) {
9998
image.attr({
10099
xmlns: xmlnsNamespaces.svg,
101100
'xlink:href': imageData,
102-
x: size.l,
103-
y: size.t,
104-
width: size.w,
105-
height: size.h,
101+
x: 0,
102+
y: 0,
103+
width: '100%',
104+
height: '100%',
106105
preserveAspectRatio: 'none'
107106
});
108107

src/plots/gl3d/scene.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) {
147147
try {
148148
STATIC_CONTEXT = STATIC_CANVAS.getContext('webgl', {
149149
preserveDrawingBuffer: true,
150-
premultipliedAlpha: true
150+
premultipliedAlpha: true,
151+
antialias: true
151152
});
152153
} catch(e) {
153154
throw new Error('error creating static canvas/context for image server');

0 commit comments

Comments
 (0)