Add padding code + tests.
Merge pull request #196 from dwf/pad_in_window_flip

Add padding code + tests.