fix for misaligned footer

Footer was previously misaligned (even though it is working well for the header) when scrollX and scrollY are enabled, and when the vertical scrollbar is present and the horizontal scrollbar is placed at the extreme right.

FIX: Just copied the header's code that was missing for footer.