-1

Hi I am trying to get the upper Left and lower right coordinates of the rectangle on the canvas. you can draw the canvas by clicking Rectangle checkbox and using the mouse down event. How can I display x and y coordinates. Please help http://jsfiddle.net/K5wcs/2/

 <input type="text" id="XCoordinate" value="" >
    <span>Metric</span>
  <input type="text" id="YCoordinate" value="" >
    <span>Metric</span>
tryingtolearn
  • 177
  • 14

1 Answers1

0

I got my answer:

        mySel.x = mx - offsetx;
        mySel.y = my - offsety;


$mouse.innerHTML = "(" + mySel.x + "," + mySel.y + ")" ;

and in the end add this to HTML

 <div id="MouseCoords"></div>
tryingtolearn
  • 177
  • 14