Skip to content

Commit

Permalink
馃悰 (editor) Fix groups graphPosition round coordinates saving
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 14, 2024
1 parent d171aa6 commit e3470bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export const GroupNode = ({ group, groupIndex }: Props) => {
}

moveFocusedGroups({
x: Number((delta[0] / graphPosition.scale).toFixed(2)),
y: Number((delta[1] / graphPosition.scale).toFixed(2)),
x: delta[0] / graphPosition.scale,
y: delta[1] / graphPosition.scale,
})

if (last) {
Expand Down
8 changes: 6 additions & 2 deletions apps/builder/src/features/graph/hooks/useGroupsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ export const useGroupsStore = createWithEqualityFn<Store>()(
(coords, groupId) => ({
...coords,
[groupId]: {
x: groupsCoordinates[groupId].x + delta.x,
y: groupsCoordinates[groupId].y + delta.y,
x: Number(
(groupsCoordinates[groupId].x + delta.x).toFixed(2)
),
y: Number(
(groupsCoordinates[groupId].y + delta.y).toFixed(2)
),
},
}),
groupsCoordinates
Expand Down

0 comments on commit e3470bc

Please sign in to comment.