rohitvarkey / ThreeJS.jl

Julia interface to WebGL using Three-js custom elements and Patchwork.jl
https://rohitvarkey.github.io/ThreeJS.jl
Other
56 stars 15 forks source link

Fix for outerdiv size bug #38

Closed izaid closed 8 years ago

izaid commented 8 years ago

The function ThreeJS.outerdiv currently does not set the size properly. This PR fixes that bug. The details are as follows:

It's pretty well-known that the ThreeJS renderer interacts a little strangely with the div it's contained in, see https://www.quora.com/What-is-a-good-way-to-put-ThreeJS-into-a-Div for instance. The best strategy I've found is to force the renderer to always be exactly the size of its enclosing div by appropriate calls to renderer.setSize. This wasn't being done before, now it is.

It's likely still possible that there are ways to resize the enclosing div that won't resize the renderer, but this PR is a good start. It fixes https://github.com/rohitvarkey/ThreeJS.jl/issues/37.

rohitvarkey commented 8 years ago

I'll merge this now. Can you also submit this PR to three-js?

izaid commented 8 years ago

Yeah, will do.