开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.
fix(freehand): fix freehand creation issue(caused by throttleRAF) (#40)
pubuzhixing8e130fb5cc507
diff --git a/packages/drawnix/src/plugins/freehand/with-freehand-create.ts b/packages/drawnix/src/plugins/freehand/with-freehand-create.tsindex ca36b5a..a40162a 100644--- a/packages/drawnix/src/plugins/freehand/with-freehand-create.ts+++ b/packages/drawnix/src/plugins/freehand/with-freehand-create.ts@@ -51,18 +51,19 @@ export const withFreehandCreate = (board: PlaitBoard) => {if (isDrawing) {throttleRAF(board, 'with-freehand-creation', () => {generator?.destroy();- const newPoint = toViewBoxPoint(- board,- toHostPoint(board, event.x, event.y)- );- points.push(newPoint);- const pointer = PlaitBoard.getPointer(board) as FreehandShape;-- temporaryElement = createFreehandElement(pointer, points);- generator.processDrawing(- temporaryElement,- PlaitBoard.getElementActiveHost(board)- );+ if (isDrawing) {+ const newPoint = toViewBoxPoint(+ board,+ toHostPoint(board, event.x, event.y)+ );+ points.push(newPoint);+ const pointer = PlaitBoard.getPointer(board) as FreehandShape;+ temporaryElement = createFreehandElement(pointer, points);+ generator.processDrawing(+ temporaryElement,+ PlaitBoard.getElementActiveHost(board)+ );+ }});return;}