The trial and error value you got is good for special window size (it will be different for 1024x768 and 800x600).
You should use the following function to get width and height of the EJS window frame and calculate suitable values for your program.

_view.drawingFrame.getWidth();
_view.drawingFrame.getHeight();

where drawingFrame is the name of your top level frame (It might be different if you changed the name when you created the view.)