I am currently incorporating webgl using three.js into a liferay portlet. My goal is to have the renderer adjust the image (canvas element) size whenever there are changes made to the page layout that affect the portlet size. Essentially, I want the canvas to resize automatically when the portlet resizes by utilizing the three.js calls. With three.js, I can manipulate the size of the canvas through the renderer object. However, the challenge lies in obtaining the width of the portlet. Is there a method to capture a redraw event and extract the portlet width in order to properly resize the canvas element?
Appreciate any guidance on this matter.