Fix for invalid placement after rotation.
Issue #3040.