add 2d selection and delete
This commit is contained in:
@@ -9,6 +9,7 @@ import * as Constants from '../../../types/world/worldConstants';
|
||||
import { useVersionContext } from '../version/versionContext';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { getUserData } from '../../../functions/getUserData';
|
||||
import { useSelectedPoints } from '../../../store/simulation/useSimulationStore';
|
||||
|
||||
// import { upsertWallApi } from '../../../services/factoryBuilder/wall/upsertWallApi';
|
||||
// import { deleteWallApi } from '../../../services/factoryBuilder/wall/deleteWallApi';
|
||||
@@ -38,6 +39,7 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
const { projectId } = useParams();
|
||||
const [dragOffset, setDragOffset] = useState<THREE.Vector3 | null>(null);
|
||||
const { hoveredLine, setHoveredLine, hoveredPoint } = useBuilderStore();
|
||||
const { selectedPoints } = useSelectedPoints();
|
||||
|
||||
const path = useMemo(() => {
|
||||
const [start, end] = points.map(p => new THREE.Vector3(...p.position));
|
||||
@@ -372,8 +374,8 @@ function Line({ points }: Readonly<LineProps>) {
|
||||
onClick={() => {
|
||||
handlePointClick(points);
|
||||
}}
|
||||
onPointerOver={() => {
|
||||
if (!hoveredLine) {
|
||||
onPointerOver={(e) => {
|
||||
if (!hoveredLine && selectedPoints.length === 0 && e.buttons === 0 && !e.ctrlKey) {
|
||||
setHoveredLine(points);
|
||||
setIsHovered(true)
|
||||
if (toolMode === 'move' && !hoveredPoint) {
|
||||
|
||||
Reference in New Issue
Block a user