开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.
fix(board): use updateViewBox to fix board wobbles when dragging or resizing (#94)
pubuzhixing8c81e55f0fcb9
diff --git a/packages/react-board/src/wrapper.tsx b/packages/react-board/src/wrapper.tsxindex 7b12ca4..5f9297b 100644--- a/packages/react-board/src/wrapper.tsx+++ b/packages/react-board/src/wrapper.tsx@@ -26,6 +26,7 @@ import {updateViewportOffset,initializeViewBox,withI18n,+ updateViewBox,} from '@plait/core';import { BoardChangeData } from './plugins/board';import { useCallback, useEffect, useState } from 'react';@@ -157,7 +158,11 @@ export const Wrapper: React.FC<WrapperProps> = ({parent: board,parentG: PlaitBoard.getElementHost(board),});- initializeViewBox(board);+ if (isSetViewport) {+ initializeViewBox(board);+ } else {+ updateViewBox(board);+ }updateViewportOffset(board);const selectedElements = getSelectedElements(board);selectedElements.forEach((element) => {