Skip to content

Commit 778560b

Browse files
committed
fix gl2d snapshot rendering
1 parent 51228fb commit 778560b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
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 & 2 deletions
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');
@@ -183,7 +184,6 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) {
183184

184185
if(!scene.staticMode) {
185186
scene.glplot.canvas.addEventListener('webglcontextlost', function(ev) {
186-
console.log('lost context');
187187
ev.preventDefault();
188188
});
189189
}

0 commit comments

Comments
 (0)