This does not seem right to me.  If I've done the math correctly above, both dx and dy are non-zero.  But one of the preview dimensions matches the screen dimension, so no translation in that dimension should be necessary.