Skip to content

Instantly share code, notes, and snippets.

@thcolin
Last active August 23, 2017 12:40
Show Gist options
  • Save thcolin/43006559c215e27224c08f584ea064aa to your computer and use it in GitHub Desktop.
Save thcolin/43006559c215e27224c08f584ea064aa to your computer and use it in GitHub Desktop.
Reflections about virutal list (or scroll)
          ┌───────────────┐     ┌─────────────┐      ┌─────────────┐      ┌─────────────┐
          │ ┌───────────┐ │     │┌───────────┐│      │┌───────────┐│      │┌───────────┐│
          │ │     0     │ │     ││     0     ││      ││     0     ││      ││     1     ││
          │ └───────────┘ │     │└───────────┘│      │└───────────┘│      │└───────────┘│
 viewport │               │     ├─────────────┤      ├─────────────┤      ├─────────────┤
          │ ┌───────────┐ │     │┌───────────┐│      │┌───────────┐│      │┌───────────┐│
          │ │     1     │ │     ││     1     ││      ││     1     ││      ││     2     ││
          │ └───────────┘ │     │└───────────┘│      │└───────────┘│      │└───────────┘│
          └┬─────────────┬┘    ┌┴─────────────┴┐     ├─────────────┤     ┌┴─────────────┴┐
           │┌───────────┐│     │ ┌───────────┐ │     │┌───────────┐│     │ ┌───────────┐ │
           ││     2     ││     │ │     2     │ │     ││     2     ││     │ │     3     │ │
           │└───────────┘│     │ └───────────┘ │     │└───────────┘│     │ └───────────┘ │
 breakRate ├─────────────┤     │               │    ┌┴─────────────┴┐    │               │
           │┌───────────┐│     │ ┌───────────┐ │    │ ┌───────────┐ │    │ ┌───────────┐ │
           ││     3     ││     │ │     3     │ │    │ │     3     │ │    │ │     4     │ │
           │└───────────┘│     │ └───────────┘ │    │ └───────────┘ │    │ └───────────┘ │
    offset └─────────────┘     └┬─────────────┬┘    │               │    └┬─────────────┬┘
                                │┌───────────┐│     │ ┌───────────┐ │     │┌───────────┐│
                                ││     4     ││     │ │     4     │ │     ││     5     ││
                                │└───────────┘│     │ └───────────┘ │     │└───────────┘│
                                ├─────────────┤     └┬─────────────┬┘     ├─────────────┤
                                │┌───────────┐│      │┌───────────┐│      │┌───────────┐│
                                ││     5     ││      ││     5     ││      ││     6     ││
                                │└───────────┘│      │└───────────┘│      │└───────────┘│
                                └─────────────┘      └─────────────┘      └─────────────┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment