05-04-2023, 11:45 AM 
	
	
	(05-04-2023, 11:05 AM)rich2005 Wrote:(05-04-2023, 10:51 AM)Ofnuts Wrote: The number of complete celles is the integer division of the window width, minus the offset, by a "cell". Then you have to figure out what it on the left and what is on the right (wich depends on offset and space).
Well, that is what I did, except took the case where the offset = zero. Are you saying that is not equal to the general case as well ?
No because you have edge cases (literally and figuratively) where a good part of the grid is outside the window, which increases the size of the visible spaces. For instance, for a 5+2 pattern and a width of 23:
Code:
offset  0, total  17 ([5, 5, 5, 2])
offset  1, total  16 ([5, 5, 5, 1])
offset  2, total  15 ([5, 5, 5])     # 4 full lines showing
offset  3, total  16 ([1, 5, 5, 5])
offset  4, total  17 ([2, 5, 5, 5])
offset  5, total  17 ([3, 5, 5, 4])
offset  6, total  17 ([4, 5, 5, 3])And this is a very practical problem, I need this to know in advance the size of a layer where I keep only the spaces.

