Fix horizontal and vertical shears.

They were not composing with translations correctly.
Added unittests to test the correct behavior.