(6 hours ago)SMcNeill Wrote: Seems to me that what you have here is a simple less than/greater than comparison.
...
Just simple multiplication and equality comparison, with a little subtraction to get your leftover spots.
Thanks Steve, that would probably streamline the logic a little. I still want to show the user all the available layouts, in order of "best fit" to "most leftover spaces".
The part this really needs help with, is what I said to PhilOfPerth - figuring this out for a collection of pictures of non-uniform size and orientation, and laying them out inside a given picture frame to make best use of the space, but also for the different picture sizes & orientations to be distributed somewhat evenly (but not so evenly that the layout looks weird or monotonous). Maybe in some cases it could blow some pictures up (e.g., make them 1.5x, 2x, etc.) and shrink others, so they fit evenly. And then the user can tweak it with the mouse.
By the way, I just thought of the blowing some pictures up & shrinking others as I was typing this reply, so just chatting with you guys and describing what I'm trying to accomplish is helping me come up with ideas for solutions or user options, so thank you for listening! LoL