Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grid Formatting Demo
#15
(02-21-2025, 08:07 PM)SMcNeill Wrote: Again, you're not maintaining your set ratios.  
This was the problem - and I figured out why this was happening: 

At some point I had the "bright idea" to "tweak" the logic to minimize unused space by incrementing or decrementing by a single row or column, where 

IF NumRows * (NumColumns +1) >= ItemCount
or 
IF (NumRows+1) * NumColumns >= ItemCount

then it would settle on that as the final number of rows/columns.

However, this had the undesired side effect that the ratio would now be altered.

Later, I totally forgot I had been playing with that idea, and consequently never went back to clean up the code and remove that logic. DOH! 

Thanks again for sharing your solution - very clean and compact, too!
Reply


Messages In This Thread
Grid Formatting Demo - by SMcNeill - 02-21-2025, 05:59 PM
RE: Grid Formatting Demo - by Pete - 02-21-2025, 06:52 PM
RE: Grid Formatting Demo - by SMcNeill - 02-21-2025, 06:54 PM
RE: Grid Formatting Demo - by madscijr - 02-21-2025, 07:09 PM
RE: Grid Formatting Demo - by SMcNeill - 02-21-2025, 07:29 PM
RE: Grid Formatting Demo - by madscijr - 02-21-2025, 07:45 PM
RE: Grid Formatting Demo - by Pete - 02-21-2025, 07:13 PM
RE: Grid Formatting Demo - by SMcNeill - 02-21-2025, 07:36 PM
RE: Grid Formatting Demo - by SMcNeill - 02-21-2025, 08:07 PM
RE: Grid Formatting Demo - by madscijr - 02-24-2025, 04:14 PM
RE: Grid Formatting Demo - by Pete - 02-21-2025, 08:15 PM
RE: Grid Formatting Demo - by madscijr - 02-21-2025, 09:26 PM
RE: Grid Formatting Demo - by madscijr - 02-21-2025, 09:58 PM
RE: Grid Formatting Demo - by SMcNeill - 02-22-2025, 12:16 AM
RE: Grid Formatting Demo - by madscijr - 02-22-2025, 03:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  MouseMovement Demo SMcNeill 0 642 10-15-2023, 11:42 PM
Last Post: SMcNeill
  Isometric Mapping Demo SMcNeill 2 1,022 09-23-2023, 03:33 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)