Skip to content

Commit

Permalink
redraw arrows when editing existing document
Browse files Browse the repository at this point in the history
  • Loading branch information
kentis committed Mar 8, 2022
1 parent 1dfd205 commit 7804f69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const Grid: FC<GridProps> = ({
const [arrowItems, setArrowItems] = useState(initialArrowItems ?? []);
const [classicArrowItems, setClassicArrowItems] = useState<
Array<ClassicArrowItemType>
>([]);
>(initialArrowItems as ClassicArrowItemType[] ?? []);
const [occupiedCells, setOccupiedCells] = useState<Array<OccupiedCell>>([]);
const [boxStartIndex, setBoxStartIndex] = useState<number | null>(null);
const [isDragging, setIsDragging] = useState(false);
Expand Down Expand Up @@ -136,6 +136,7 @@ export const Grid: FC<GridProps> = ({
useEffectOnce(() => {
// eslint-disable-next-line no-param-reassign
updateGrid.current = updateLocalGrid;
updateGridDimensions({ numberOfColumns, numberOfRows });
});

const elementRef = useRef<HTMLDivElement>(null);
Expand Down
3 changes: 3 additions & 0 deletions src/types/ArrowItemType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ export type ArrowItemType = CommonItemType & {

startPosition: Position;
endPosition: Position;

startGridPosition: Position;
endGridPosition: Position;
};

0 comments on commit 7804f69

Please sign in to comment.