diff --git a/src/components/grid/grid.tsx b/src/components/grid/grid.tsx index d1576ad..aa117d8 100644 --- a/src/components/grid/grid.tsx +++ b/src/components/grid/grid.tsx @@ -153,7 +153,6 @@ const Grid: FC = () => { ); setRedoActions([]); - // single-click tools if (drawModeInfo.pointsType === 'single') { const toolLines = drawModeInfo.getToolLines( point, @@ -165,7 +164,6 @@ const Grid: FC = () => { return; } - // click and drag tools ------------------------------------------- if (lodash.isEqual(startPoint, point)) { setStartPoint(null); return; @@ -330,17 +328,12 @@ const Grid: FC = () => { }, [startPoint, mousePoint, drawMode, drawModeInfo, lineColor]); const startPointElement = useMemo(() => { - let point = snapToGrid( + if (drawModeInfo.pointsType === 'single') return null; + const point = snapToGrid( mousePoint, drawModeInfo.gridGap, drawModeInfo.gridOffset ); - if ( - drawMode === 'square' || - drawMode === 'square-small' || - drawMode === 'star' - ) - return null; return ( { cy={point.y} r="4" fill={ - drawMode === 'line' || drawMode === 'grid' - ? lineColor - : '#ff0000' + drawModeInfo.pointsType === 'double' ? lineColor : '#ff0000' } /> );