CSS transforms are hard. Maybe my argument above doesn't make sense.  If you're positioning the preview at 0,0 and then rotating around its center, then I suppose you would have to translate in two dimensions.  I think the code above would be simpler if you set style.left and style.top when you set style.width and style.height below.  If you position the preview stream so that its center is at the center of the screen, then when you rotate it, nothing needs to change.