vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
290 stars 86 forks source link

Add preserveDrawingBuffer to default options #64

Closed MPanknin closed 1 year ago

MPanknin commented 1 year ago

Hi there,

we would like to suggest to add preserveDrawingBuffer to the DxfViewer.DefaultOptions. It still defaults to false so there shouldn't be any side effects when not setting it.

The reason for this change is that we need to take screenshots of multiple layered canvas objects in our application, and for this to work, the renderer's drawing buffer needs to be preserved.

Thx

vagran commented 1 year ago

Thanks! Looks good. However, I think in next release with breaking changes all three.WebGLRenderer parameters will be moved to a separate options subobject so that any its option could be overridden.

MPanknin commented 1 year ago

so that any its option could be overridden

That sounds very useful indeed. Is there already an ETA for this?

Thanks a lot!

vagran commented 1 year ago

That sounds very useful indeed. Is there already an ETA for this?

Adding this feature is trivial, but it breaks current interface (since it is undesirable to keep both ways to set renderer options), so this will be done in the next major release. I am currently started work on it, however it is a huge redesign of the library, my current estimation is about 2023 Q4. So if you just need any other option right now, it can be added in the same way.