update height reference and buffer size when window is resized