summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/pugl.js b/pugl.js
index 7708b31..aea16fd 100644
--- a/pugl.js
+++ b/pugl.js
@@ -2822,10 +2822,16 @@ function startup() {
if (!has_error()) export_widgets_to_local_storage();
});
- gl = canvas.getContext('webgl2');
+ const context_attributes = {
+ // without this, "save image as..." is broken on firefox
+ // see https://bugzilla.mozilla.org/show_bug.cgi?id=749824
+ preserveDrawingBuffer: true,
+ };
+
+ gl = canvas.getContext('webgl2', context_attributes);
if (gl === null) {
// support for very-old-but-not-ancient browsers
- gl = canvas.getContext('experimental-webgl2');
+ gl = canvas.getContext('experimental-webgl2', context_attributes);
if (gl === null) {
show_error('your browser doesnt support webgl2.\noh well.');
return;