javascript - Raphaeljs resize canvas to fit content -


I have content in Raphael which is more than the canvas size, I want to extend the canvas and around the canvas Can contain a container so that the user can view all the contents.

  & lt; Div class = "canvas_container" id = "canvas_container" & gt; & Lt; Svg & gt; & Lt; / Svg & gt; & Lt; / Div & gt;  

Is there any way that I can resize the canvas of Raphael because all the content has been loaded so that it all goes well? In fact, a "fit to scale" is set to set scrollable overflow to my canvas_container divas, so if I can resize Raphael to fit everything, then it should work.

You can iterate all the elements in your Rafael canvas and calculate the size of your image You can get the bounding boxes and then resize the canvas.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -