Paul Clapham wrote:To make sure those two objects are not the same object you do this:
Was that what you meant?
Yes, I'm not sure how .equals() would work with an object like that, but it works fine.
I managed to find the solution myself, when x and y were changing, all the of rectangles were not updated, so therefore creating a loop decreasing x and y when they weren't updating to their new positions after each loop resulted in an endless loop, thus causing the error.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com