First of all, the triangle you have above is not a right triangle. It doesn't pass the Pythagorean Theorem.
But to answer your question anyway, you should use similarity. Call the horizontal leg $B$, the vertical leg $A$, and the hypotenuse $H$ (assuming these do form a right triangle). Recycle these letters for the respective lengths for these line segments as well.
Say you want the hypotenuse to be of length $h = H+k$ instead of length $H$ (where $k$ is some integer), but you don't want to change the shape of the triangle above - that is, you want the newly formed triangle to be similar to the one drawn above. If the horizontal leg of the newly formed triangle is $b$, the vertical leg $a$, then you must have
$\frac{h}{b} = \frac{H}{B} \quad \Longrightarrow \quad b = \frac{hB}{H}$,
$\frac{h}{a} = \frac{H}{A} \quad \Longrightarrow \quad a = \frac{hA}{H}$.
Note that $a,b$ may not be integers, but they do determine a hypotenuse of length $h$, for
$a^2 + b^2 = \left(\frac{hA}{H} \right)^2 + \left(\frac{hB}{H} \right)^2 = \frac{h^2(A^2+B^2)}{H^2} = h^2$.