CAT-1060 #done fix ifOnEdgeBounce logic

change repositioning logic
adapt tests
differ between horizontal and vertical border