Skip to content

Commit 938d2bc

Browse files
authored
Update README.md
Add calculation of positions
1 parent 4341d19 commit 938d2bc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ While developing the app, you can take a look at the static pages that you'll ev
2828

2929
The starting point of the application is the `/client/src/index.js` file. That's where the root component of the application - `Application` - is rendered to the DOM. You can add new components to the `/client/src/components` folder.
3030
```
31+
32+
## Calculation of item positions
33+
34+
- If the item is the first to be created in the group, it gets a position of 65535.
35+
- If the item is inserted at the beginning of the group, the position becomes half of the previously-first item’s position.
36+
- If the item is inserted at the end of the list, the position becomes the previously-last item’s position plus 65536
37+
- If the item is inserted between two other items, the position becomes `(itemBefore.position + itemAfter.position) / 2`.
38+
- Positions are floats with a high precision (10 digits or so)

0 commit comments

Comments
 (0)