Fix css rotation for canvas and text layer.

I believe this could all be simplified if we instead just did everything at one orientation and then rotated, but that will be an even bigger change.