You can buy this project and download/modify it how often you want.
<rect> x modification in 'onclick' <rect> x modification in 'onclick' Position A Position B Click on the Position A or Position B target (crimson circle) to move the rectangle to a new position