xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
738 stars 291 forks source link

"getShapshot" appends canvas elements to the body #1377

Closed Trufinol closed 9 months ago

Trufinol commented 9 months ago

Describe the bug Whenever "viewer.getShapshot" is called - it creates a snapshot successfully but also adds a canvas element of that snapshot to the body. The method is also followed by the warning log in the browser's console: #1 217ms Unable to clone WebGL context as it has preserveDrawingBuffer=false <canvas id=​"nav-cube-canvas" width=​"140" height=​"140" style=​"visibility:​ visible;​">​ The complete browser's warning log file is attached localhost-1708504159624.log

To Reproduce Steps to reproduce the behavior:

  1. run viewer.getSnapshot({ format: 'png' })
  2. Check out the canvas element that is appended to the body.

Expected behavior It should not append a canvas element to the body, or the canvas should be removed after the method is complete.

Screenshots image image

Desktop (please complete the following information):

paireks commented 9 months ago

Hey :)

I'm trying to reproduce it, but it seems I miss something in the process. I tried to paste viewer.getSnapshot({ format: 'png' }) in a few different examples, but I can't see additional canvases created, and can't see your warning log. Also if creating snapshots would work that way, I believe all example files from "snapshots" folder would create a warning and append canvas, but they looks fine to me. Or am I missing something? :)

xeolabs commented 9 months ago

Not seeing it here either - after running various test examples on my end (like this one), I'm not seeing any canvas elements being appended to the DOM.

We'll re-open if this can be reproduced.