You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to include three-dxf in a React component and making it responsive. I managed to achieve that by deleting the previous
canvas and rendering a new one but I noticed you wrote a function resize for the renderer:
I gave it a try since it would save some processing not having to redraw the dxf but I only see the canvas being stretch, it doesn't keep the aspect ratio and when I zoom or move, it goes back to the previous size.
It seems like it doesn't update the camera parameters, but I am really not an expert with three.js
The text was updated successfully, but these errors were encountered:
You need to call instance on ThreeDxf.Viewer something like
dxfViewer.renderer.setSize(width, height);
and then update that with
dxfViewer.render(scene, camera)
Plus I think you have to write your resize method / function with eventListener and call this in your component.
You can try doing this with the resize(width, height) function of the dxfViewer. But it looks like you need to listen for the resize event.
Hi and thanks for this very good development!
I am trying to include three-dxf in a React component and making it responsive. I managed to achieve that by deleting the previous
canvas and rendering a new one but I noticed you wrote a function resize for the renderer:
three-dxf/src/index.js
Line 176 in 20e14cb
I gave it a try since it would save some processing not having to redraw the dxf but I only see the canvas being stretch, it doesn't keep the aspect ratio and when I zoom or move, it goes back to the previous size.
It seems like it doesn't update the camera parameters, but I am really not an expert with three.js
The text was updated successfully, but these errors were encountered: