1
0

feat: improve ProjectSettingsViews

(cherry picked from commit e8be657d9775a592987b684250809eb3d170a6f1)
This commit is contained in:
Dominik Pschenitschni
2024-07-17 22:52:13 +02:00
committed by kolaente
parent d7c5451729
commit 811ccc1baa
2 changed files with 31 additions and 26 deletions

View File

@ -1,4 +1,7 @@
export const calculateItemPosition = (positionBefore: number | null, positionAfter: number | null): number => {
export const calculateItemPosition = (
positionBefore: number | null = null,
positionAfter: number | null = null,
): number => {
if (positionBefore === null) {
if (positionAfter === null) {
return 0
@ -13,6 +16,6 @@ export const calculateItemPosition = (positionBefore: number | null, positionAft
return positionBefore + Math.pow(2, 16)
}
// If we have both a task before and after it, we acually calculate the position
// If we have both a task before and after it, we actually calculate the position
return positionBefore + (positionAfter - positionBefore) / 2
}