Reputation: 1923
I am trying implement an excel-like click+drag feature where the user clicks on a cell and drags. When the user stops dragging, I am able to calculate the top left corner and the bottom right corner of the rectangle. I can also easily calculate the length, height and area of the rectangle, but how do I calculate the coordinates inside the rectangle?
Upvotes: 0
Views: 1396
Reputation: 16007
Pseudocode:
for i = left_edge to right_edge
for j = top_edge to bottom_edge
add [i, j] to list of points inside rectangle
Upvotes: 1