A landscaper is designing a flower garden in the shape of a right triangle. She wants 10ft of a perennial border to form the hypotenuse of the triangle, and one leg is to be 2ft longer than the other. Find the lengths of the legs?