Архитектурный шаблон "Мрак в моделях" на нескольких языках и платформах
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

javaScript.js 568B

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1234567891011121314151617181920212223
  1. function memoryGap() {
  2. return memorySide() + memorySpace();
  3. }
  4. function memorySide() {
  5. return 50;
  6. }
  7. function memorySpace() {
  8. return 20;
  9. }
  10. function memoryItemPositions(c) {
  11. var pos = [];
  12. // @ts-ignore
  13. var ids = utsIndexArray(c.itemsCount);
  14. ids.forEach(function (i) {
  15. // @ts-ignore
  16. var row = utsFloor(Number(i) / 4);
  17. var x = memoryGap() + (Number(i) - row * 4) * memoryGap();
  18. var y = memoryGap() + row * memoryGap();
  19. // @ts-ignore
  20. pos.push(memoryCreatePosition(x, y));
  21. });
  22. return pos;
  23. }