Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a sample photo set #26

Closed
programmerr47 opened this issue Jan 7, 2020 · 3 comments
Closed

Create a sample photo set #26

programmerr47 opened this issue Jan 7, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@programmerr47
Copy link
Owner

Currently we have just an "infinite" list of images with a same items, but more interesting, to see, how it works on other view structures.

Let's create a custom view, that fits entire screen and contains itself a random grid of images with different sizes and positions (since we have no information about images, provided by api, to make it more appropriate)

@programmerr47 programmerr47 added the enhancement New feature or request label Jan 7, 2020
@programmerr47
Copy link
Owner Author

So currently I've invented in my had a small algorithm to split rectangle on a list of random rectangles. At first I had in mind simple one (which is still a backup plan):

  1. Split rectangle on two with either vertical or horizontal line.
  2. Continue that for both subrectangles.
  3. Continue 1. and 2. until some point of time

But I don't like the limitation of rectangle splitting. Because is too clumsy. It looks like you hack each rectandles on two parts every time. Which is too obvious.

So my algorithm is next:

  1. Pick a pixel in the edge of rectangle
  2. Start drawing line from it, perpenicular to the starting edge.
  3. Proceed to the other edge on stop between them
  4. If you stopped in the middle, start emit two line in one of sides (left, right, top, bottom) except the side of original line.
  5. For each line continue either to the edge or already draw line; or stop in the middle
  6. Continue 4 and 5, until the is no "middle" lines left

With this algorithm it is possible to draw something like:

 _________
|  |______| 
|__|___|  |
|______|__| 

Which is not possible with first algorithm. Moreover second one extend the first one in terms of number of possibilities

@programmerr47
Copy link
Owner Author

Finally I've implemented first algorithm. For the second one will explicitly create a new task

@programmerr47
Copy link
Owner Author

#31 - is a task for enhancement collage generating algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant