Fixed canvas height calculation