Hi all,
Background:
I am dealing with graphical objects on a canvas in which the user draws four lines and out of these four lines I get the top left corner, bottom right corner and figure out the width and height from these two points.
Problem:
I have completed this but I would also like to use a for loop to get every set of 4 integers in my vector which represent a rectangle and draw it to canvas. Overall printing every rectangle drawn on the canvas. The first rectangle prints fine although the program freezes there after.
Here is the for loop I have tried to use to print of all rectangles drawn on the canvas which currently prints the top left corner point and bottom right corner point out of all rectangles:
for(int z=0; z < 5; z++) {
//for(int i =0 ; i < 5; i++){
rectangle1 = (Point) vector.get(z);
//Point b = (Point) vectorRect.get(i);
graf.drawRect(topLeftPoint.x, topLeftPoint.y, width, height);
}
//z = i+1;
//}
This probably relates to these points which are used prior to calculating the width and height:
bottomRightPoint = (Point) vector.get(0);
topLeftPoint = (Point) vector.get(0);
A similar for loop is probably required; even psuedocode would be very helpful.
Thanks in advance,
Cleo