Fix select line
This commit is contained in:
@@ -13,18 +13,12 @@ type Axis = 'x' | 'y';
|
|||||||
export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
||||||
const svgRef = useRef<SVGSVGElement>(null);
|
const svgRef = useRef<SVGSVGElement>(null);
|
||||||
|
|
||||||
// State for interaction
|
// State
|
||||||
const [phantomAxis, setPhantomAxis] = useState<Axis | null>(null);
|
const [phantomAxis, setPhantomAxis] = useState<Axis | null>(null);
|
||||||
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
|
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
|
||||||
const [hoveredSplit, setHoveredSplit] = useState<{ axis: Axis; index: number } | null>(null);
|
const [hoveredSplit, setHoveredSplit] = useState<{ axis: Axis; index: number } | null>(null);
|
||||||
const [dragging, setDragging] = useState<{ axis: Axis; index: number } | null>(null);
|
const [dragging, setDragging] = useState<{ axis: Axis; index: number } | null>(null);
|
||||||
|
|
||||||
// НОВОЕ: Состояние, чтобы кнопка не исчезала, пока мы на ней
|
|
||||||
const [isButtonHovered, setIsButtonHovered] = useState(false);
|
|
||||||
|
|
||||||
// Constants
|
|
||||||
// Увеличил порог с 0.02 до 0.03, чтобы линию было легче поймать
|
|
||||||
const SNAP_THRESHOLD = 0.03;
|
|
||||||
const viewBoxW = 1000;
|
const viewBoxW = 1000;
|
||||||
const aspectRatio = config.drawer.depth / config.drawer.width;
|
const aspectRatio = config.drawer.depth / config.drawer.width;
|
||||||
const viewBoxH = viewBoxW * aspectRatio;
|
const viewBoxH = viewBoxW * aspectRatio;
|
||||||
@@ -32,8 +26,8 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
const sortedX = useMemo(() => [0, ...splits.x, 1].sort((a, b) => a - b), [splits.x]);
|
const sortedX = useMemo(() => [0, ...splits.x, 1].sort((a, b) => a - b), [splits.x]);
|
||||||
const sortedY = useMemo(() => [0, ...splits.y, 1].sort((a, b) => a - b), [splits.y]);
|
const sortedY = useMemo(() => [0, ...splits.y, 1].sort((a, b) => a - b), [splits.y]);
|
||||||
|
|
||||||
// Handlers
|
// --- Глобальный обработчик (для пустого места и перетаскивания) ---
|
||||||
const handleMouseMove = (e: React.MouseEvent) => {
|
const handleGlobalMouseMove = (e: React.MouseEvent) => {
|
||||||
if (!svgRef.current) return;
|
if (!svgRef.current) return;
|
||||||
const rect = svgRef.current.getBoundingClientRect();
|
const rect = svgRef.current.getBoundingClientRect();
|
||||||
const nx = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
const nx = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
||||||
@@ -41,6 +35,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
|
|
||||||
setMousePos({ x: nx, y: ny });
|
setMousePos({ x: nx, y: ny });
|
||||||
|
|
||||||
|
// 1. Если тащим - обновляем позицию
|
||||||
if (dragging) {
|
if (dragging) {
|
||||||
const newSplits = {
|
const newSplits = {
|
||||||
x: [...splits.x],
|
x: [...splits.x],
|
||||||
@@ -52,71 +47,69 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ИСПРАВЛЕНИЕ: Если мышка на кнопке удаления, не пересчитываем hover,
|
// 2. Если мы здесь, значит мышка НЕ на существующей линии
|
||||||
// чтобы кнопка не исчезла под курсором.
|
// (иначе событие было бы перехвачено в handleSplitHover)
|
||||||
if (isButtonHovered) return;
|
setHoveredSplit(null);
|
||||||
|
|
||||||
// Hover logic
|
// 3. Логика Фантомной линии (создание новой)
|
||||||
let foundSplit = null;
|
const SNAP_THRESHOLD = 0.02;
|
||||||
|
|
||||||
// Check X splits
|
// Проверяем, не слишком ли мы близко к краям или другим линиям (чтобы не спамить)
|
||||||
splits.x.forEach((val, idx) => {
|
const closeToX = splits.x.some(val => Math.abs(nx - val) < SNAP_THRESHOLD);
|
||||||
if (Math.abs(nx - val) < SNAP_THRESHOLD) foundSplit = { axis: 'x' as Axis, index: idx };
|
const closeToY = splits.y.some(val => Math.abs(ny - val) < SNAP_THRESHOLD);
|
||||||
});
|
const closeToEdgeX = nx < SNAP_THRESHOLD || nx > (1 - SNAP_THRESHOLD);
|
||||||
|
const closeToEdgeY = ny < SNAP_THRESHOLD || ny > (1 - SNAP_THRESHOLD);
|
||||||
|
|
||||||
// Check Y splits
|
const distLeft = nx;
|
||||||
if (!foundSplit) {
|
const distRight = 1 - nx;
|
||||||
splits.y.forEach((val, idx) => {
|
const distTop = ny;
|
||||||
if (Math.abs(ny - val) < SNAP_THRESHOLD) foundSplit = { axis: 'y' as Axis, index: idx };
|
const distBottom = 1 - ny;
|
||||||
});
|
|
||||||
|
const minXDist = Math.min(distLeft, distRight);
|
||||||
|
const minYDist = Math.min(distTop, distBottom);
|
||||||
|
|
||||||
|
// Определяем ось по близости к краю
|
||||||
|
let potentialAxis: Axis = minXDist < minYDist ? 'y' : 'x';
|
||||||
|
|
||||||
|
let valid = true;
|
||||||
|
if (potentialAxis === 'x') {
|
||||||
|
if (closeToX || closeToEdgeX) valid = false;
|
||||||
|
} else {
|
||||||
|
if (closeToY || closeToEdgeY) valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
setHoveredSplit(foundSplit);
|
if (valid) {
|
||||||
|
setPhantomAxis(potentialAxis);
|
||||||
// Phantom line logic
|
|
||||||
if (!foundSplit) {
|
|
||||||
const closeToX = splits.x.some(val => Math.abs(nx - val) < SNAP_THRESHOLD);
|
|
||||||
const closeToY = splits.y.some(val => Math.abs(ny - val) < SNAP_THRESHOLD);
|
|
||||||
const closeToEdgeX = nx < SNAP_THRESHOLD || nx > (1 - SNAP_THRESHOLD);
|
|
||||||
const closeToEdgeY = ny < SNAP_THRESHOLD || ny > (1 - SNAP_THRESHOLD);
|
|
||||||
|
|
||||||
const distLeft = nx;
|
|
||||||
const distRight = 1 - nx;
|
|
||||||
const distTop = ny;
|
|
||||||
const distBottom = 1 - ny;
|
|
||||||
|
|
||||||
const minXDist = Math.min(distLeft, distRight);
|
|
||||||
const minYDist = Math.min(distTop, distBottom);
|
|
||||||
|
|
||||||
let potentialAxis: Axis = minXDist < minYDist ? 'y' : 'x';
|
|
||||||
|
|
||||||
let valid = true;
|
|
||||||
if (potentialAxis === 'x') {
|
|
||||||
if (closeToX || closeToEdgeX) valid = false;
|
|
||||||
} else {
|
|
||||||
if (closeToY || closeToEdgeY) valid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid) {
|
|
||||||
setPhantomAxis(potentialAxis);
|
|
||||||
} else {
|
|
||||||
setPhantomAxis(null);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
setPhantomAxis(null);
|
setPhantomAxis(null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// --- Обработчик наведения на КОНКРЕТНУЮ линию ---
|
||||||
|
const handleSplitHover = (e: React.MouseEvent, axis: Axis, index: number) => {
|
||||||
|
// Если мы тащим линию, позволяем событию всплыть до глобального обработчика,
|
||||||
|
// чтобы он посчитал координаты.
|
||||||
|
if (dragging) return;
|
||||||
|
|
||||||
|
// Если просто водим мышкой - блокируем всплытие,
|
||||||
|
// чтобы глобальный обработчик не думал, что мы в пустоте.
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
setHoveredSplit({ axis, index });
|
||||||
|
setPhantomAxis(null); // Убираем фантом, раз мы на линии
|
||||||
|
};
|
||||||
|
|
||||||
const handleMouseDown = (e: React.MouseEvent) => {
|
const handleMouseDown = (e: React.MouseEvent) => {
|
||||||
// Если нажали на кнопку, событие там обработается (stopPropagation)
|
// Клик по существующей линии (hoveredSplit уже установлен через onMouseMove линии)
|
||||||
// Здесь обрабатываем только клик по пустому месту или начало драга линии
|
if (hoveredSplit) {
|
||||||
if (hoveredSplit && !isButtonHovered) {
|
|
||||||
if (e.button === 0) {
|
if (e.button === 0) {
|
||||||
setDragging(hoveredSplit);
|
setDragging(hoveredSplit);
|
||||||
} else if (e.button === 2) {
|
} else if (e.button === 2) {
|
||||||
removeSplit(hoveredSplit.axis, hoveredSplit.index);
|
removeSplit(hoveredSplit.axis, hoveredSplit.index);
|
||||||
}
|
}
|
||||||
} else if (phantomAxis && !isButtonHovered) {
|
}
|
||||||
|
// Клик по пустому месту (создание)
|
||||||
|
else if (phantomAxis) {
|
||||||
const val = phantomAxis === 'x' ? mousePos.x : mousePos.y;
|
const val = phantomAxis === 'x' ? mousePos.x : mousePos.y;
|
||||||
const newSplits = { ...splits };
|
const newSplits = { ...splits };
|
||||||
newSplits[phantomAxis] = [...newSplits[phantomAxis], val];
|
newSplits[phantomAxis] = [...newSplits[phantomAxis], val];
|
||||||
@@ -135,7 +128,6 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
onChange(newSplits);
|
onChange(newSplits);
|
||||||
setHoveredSplit(null);
|
setHoveredSplit(null);
|
||||||
setDragging(null);
|
setDragging(null);
|
||||||
setIsButtonHovered(false); // Сбрасываем блокировку
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -155,7 +147,6 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
<div className="flex flex-col h-full select-none">
|
<div className="flex flex-col h-full select-none">
|
||||||
<div className="flex-1 bg-slate-800/30 rounded-lg p-6 flex flex-col items-center justify-center relative overflow-hidden border border-slate-700/50">
|
<div className="flex-1 bg-slate-800/30 rounded-lg p-6 flex flex-col items-center justify-center relative overflow-hidden border border-slate-700/50">
|
||||||
|
|
||||||
{/* Instruction Box */}
|
|
||||||
<div className="absolute top-4 left-4 z-10 bg-slate-900/90 p-3 rounded-lg backdrop-blur border border-slate-700 shadow-xl max-w-[200px] pointer-events-none">
|
<div className="absolute top-4 left-4 z-10 bg-slate-900/90 p-3 rounded-lg backdrop-blur border border-slate-700 shadow-xl max-w-[200px] pointer-events-none">
|
||||||
<div className="flex items-center gap-2 font-bold text-gray-100 mb-2 text-sm">
|
<div className="flex items-center gap-2 font-bold text-gray-100 mb-2 text-sm">
|
||||||
<MousePointer2 size={14} className="text-primary"/> Инструкция
|
<MousePointer2 size={14} className="text-primary"/> Инструкция
|
||||||
@@ -167,7 +158,6 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Rulers */}
|
|
||||||
<div className="w-full flex justify-between px-8 mb-1 max-w-[900px]">
|
<div className="w-full flex justify-between px-8 mb-1 max-w-[900px]">
|
||||||
<span className="text-xs text-slate-500 font-mono">0</span>
|
<span className="text-xs text-slate-500 font-mono">0</span>
|
||||||
<span className="text-xs text-slate-500 font-mono">{config.drawer.width} мм</span>
|
<span className="text-xs text-slate-500 font-mono">{config.drawer.width} мм</span>
|
||||||
@@ -179,7 +169,6 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
<span className="text-xs text-slate-500 font-mono" style={{writingMode: 'vertical-rl'}}>{config.drawer.depth} мм</span>
|
<span className="text-xs text-slate-500 font-mono" style={{writingMode: 'vertical-rl'}}>{config.drawer.depth} мм</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Main Interactive SVG */}
|
|
||||||
<div
|
<div
|
||||||
className="relative shadow-2xl bg-[#1e293b] border border-slate-600 rounded-sm overflow-hidden"
|
className="relative shadow-2xl bg-[#1e293b] border border-slate-600 rounded-sm overflow-hidden"
|
||||||
style={{
|
style={{
|
||||||
@@ -194,7 +183,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
ref={svgRef}
|
ref={svgRef}
|
||||||
viewBox={`0 0 ${viewBoxW} ${viewBoxH}`}
|
viewBox={`0 0 ${viewBoxW} ${viewBoxH}`}
|
||||||
className="w-full h-full touch-none"
|
className="w-full h-full touch-none"
|
||||||
onMouseMove={handleMouseMove}
|
onMouseMove={handleGlobalMouseMove}
|
||||||
onMouseDown={handleMouseDown}
|
onMouseDown={handleMouseDown}
|
||||||
onMouseUp={handleMouseUp}
|
onMouseUp={handleMouseUp}
|
||||||
onMouseLeave={handleMouseUp}
|
onMouseLeave={handleMouseUp}
|
||||||
@@ -207,7 +196,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
</defs>
|
</defs>
|
||||||
<rect width="100%" height="100%" fill="url(#grid)" />
|
<rect width="100%" height="100%" fill="url(#grid)" />
|
||||||
|
|
||||||
{/* --- Cell Dimensions Labels --- */}
|
{/* --- Labels --- */}
|
||||||
{sortedX.slice(0, -1).map((x1, i) => {
|
{sortedX.slice(0, -1).map((x1, i) => {
|
||||||
const x2 = sortedX[i + 1];
|
const x2 = sortedX[i + 1];
|
||||||
return sortedY.slice(0, -1).map((y1, j) => {
|
return sortedY.slice(0, -1).map((y1, j) => {
|
||||||
@@ -244,7 +233,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
});
|
});
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{/* --- Existing X Lines (Vertical) --- */}
|
{/* --- X Lines (Vertical) --- */}
|
||||||
{splits.x.map((x, i) => {
|
{splits.x.map((x, i) => {
|
||||||
const isHovered = hoveredSplit?.axis === 'x' && hoveredSplit.index === i;
|
const isHovered = hoveredSplit?.axis === 'x' && hoveredSplit.index === i;
|
||||||
const isDragging = dragging?.axis === 'x' && dragging.index === i;
|
const isDragging = dragging?.axis === 'x' && dragging.index === i;
|
||||||
@@ -252,26 +241,28 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
const width = isHovered || isDragging ? 8 : 4;
|
const width = isHovered || isDragging ? 8 : 4;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<g key={`x-${i}`} onDoubleClick={() => removeSplit('x', i)}>
|
<g
|
||||||
|
key={`x-${i}`}
|
||||||
|
onDoubleClick={() => removeSplit('x', i)}
|
||||||
|
// ВАЖНО: Событие вешаем на группу
|
||||||
|
onMouseMove={(e) => handleSplitHover(e, 'x', i)}
|
||||||
|
>
|
||||||
|
{/* Невидимая широкая зона захвата (80 единиц!) */}
|
||||||
<line
|
<line
|
||||||
x1={x * viewBoxW} y1={0}
|
x1={x * viewBoxW} y1={0}
|
||||||
x2={x * viewBoxW} y2={viewBoxH}
|
x2={x * viewBoxW} y2={viewBoxH}
|
||||||
stroke="transparent" strokeWidth="60"
|
stroke="transparent" strokeWidth="80"
|
||||||
className="cursor-col-resize hover:stroke-white/5"
|
className="cursor-col-resize"
|
||||||
/>
|
/>
|
||||||
|
{/* Видимая линия */}
|
||||||
<line
|
<line
|
||||||
x1={x * viewBoxW} y1={0}
|
x1={x * viewBoxW} y1={0}
|
||||||
x2={x * viewBoxW} y2={viewBoxH}
|
x2={x * viewBoxW} y2={viewBoxH}
|
||||||
stroke={color} strokeWidth={width}
|
stroke={color} strokeWidth={width}
|
||||||
className="transition-all duration-150"
|
className="transition-all duration-150 pointer-events-none"
|
||||||
/>
|
/>
|
||||||
{(isHovered || isDragging) && (
|
{(isHovered || isDragging) && (
|
||||||
<g
|
<g transform={`translate(${x * viewBoxW}, 40)`} onClick={(e) => { e.stopPropagation(); removeSplit('x', i); }}>
|
||||||
transform={`translate(${x * viewBoxW}, 40)`}
|
|
||||||
onClick={(e) => { e.stopPropagation(); removeSplit('x', i); }}
|
|
||||||
onMouseEnter={() => setIsButtonHovered(true)} // Блокируем скрытие
|
|
||||||
onMouseLeave={() => setIsButtonHovered(false)}
|
|
||||||
>
|
|
||||||
<circle r="16" fill="#ef4444" className="cursor-pointer hover:scale-110 transition-transform shadow-lg"/>
|
<circle r="16" fill="#ef4444" className="cursor-pointer hover:scale-110 transition-transform shadow-lg"/>
|
||||||
<Trash2 size={16} color="white" x={-8} y={-8} className="pointer-events-none"/>
|
<Trash2 size={16} color="white" x={-8} y={-8} className="pointer-events-none"/>
|
||||||
</g>
|
</g>
|
||||||
@@ -280,7 +271,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{/* --- Existing Y Lines (Horizontal) --- */}
|
{/* --- Y Lines (Horizontal) --- */}
|
||||||
{splits.y.map((y, i) => {
|
{splits.y.map((y, i) => {
|
||||||
const isHovered = hoveredSplit?.axis === 'y' && hoveredSplit.index === i;
|
const isHovered = hoveredSplit?.axis === 'y' && hoveredSplit.index === i;
|
||||||
const isDragging = dragging?.axis === 'y' && dragging.index === i;
|
const isDragging = dragging?.axis === 'y' && dragging.index === i;
|
||||||
@@ -288,26 +279,25 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
const width = isHovered || isDragging ? 8 : 4;
|
const width = isHovered || isDragging ? 8 : 4;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<g key={`y-${i}`} onDoubleClick={() => removeSplit('y', i)}>
|
<g
|
||||||
|
key={`y-${i}`}
|
||||||
|
onDoubleClick={() => removeSplit('y', i)}
|
||||||
|
onMouseMove={(e) => handleSplitHover(e, 'y', i)}
|
||||||
|
>
|
||||||
<line
|
<line
|
||||||
x1={0} y1={y * viewBoxH}
|
x1={0} y1={y * viewBoxH}
|
||||||
x2={viewBoxW} y2={y * viewBoxH}
|
x2={viewBoxW} y2={y * viewBoxH}
|
||||||
stroke="transparent" strokeWidth="60"
|
stroke="transparent" strokeWidth="80"
|
||||||
className="cursor-row-resize hover:stroke-white/5"
|
className="cursor-row-resize"
|
||||||
/>
|
/>
|
||||||
<line
|
<line
|
||||||
x1={0} y1={y * viewBoxH}
|
x1={0} y1={y * viewBoxH}
|
||||||
x2={viewBoxW} y2={y * viewBoxH}
|
x2={viewBoxW} y2={y * viewBoxH}
|
||||||
stroke={color} strokeWidth={width}
|
stroke={color} strokeWidth={width}
|
||||||
className="transition-all duration-150"
|
className="transition-all duration-150 pointer-events-none"
|
||||||
/>
|
/>
|
||||||
{(isHovered || isDragging) && (
|
{(isHovered || isDragging) && (
|
||||||
<g
|
<g transform={`translate(40, ${y * viewBoxH})`} onClick={(e) => { e.stopPropagation(); removeSplit('y', i); }}>
|
||||||
transform={`translate(40, ${y * viewBoxH})`}
|
|
||||||
onClick={(e) => { e.stopPropagation(); removeSplit('y', i); }}
|
|
||||||
onMouseEnter={() => setIsButtonHovered(true)} // Блокируем скрытие
|
|
||||||
onMouseLeave={() => setIsButtonHovered(false)}
|
|
||||||
>
|
|
||||||
<circle r="16" fill="#ef4444" className="cursor-pointer hover:scale-110 transition-transform shadow-lg"/>
|
<circle r="16" fill="#ef4444" className="cursor-pointer hover:scale-110 transition-transform shadow-lg"/>
|
||||||
<Trash2 size={16} color="white" x={-8} y={-8} className="pointer-events-none"/>
|
<Trash2 size={16} color="white" x={-8} y={-8} className="pointer-events-none"/>
|
||||||
</g>
|
</g>
|
||||||
@@ -317,26 +307,26 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
|||||||
})}
|
})}
|
||||||
|
|
||||||
{/* --- Phantom Lines --- */}
|
{/* --- Phantom Lines --- */}
|
||||||
{!hoveredSplit && !dragging && !isButtonHovered && phantomAxis === 'x' && (
|
{!hoveredSplit && !dragging && phantomAxis === 'x' && (
|
||||||
<g>
|
<g className="pointer-events-none">
|
||||||
<line
|
<line
|
||||||
x1={mousePos.x * viewBoxW} y1="0"
|
x1={mousePos.x * viewBoxW} y1="0"
|
||||||
x2={mousePos.x * viewBoxW} y2="100%"
|
x2={mousePos.x * viewBoxW} y2="100%"
|
||||||
stroke="#3b82f6" strokeWidth="4" strokeDasharray="12,8"
|
stroke="#3b82f6" strokeWidth="4" strokeDasharray="12,8"
|
||||||
className="pointer-events-none opacity-60"
|
className="opacity-60"
|
||||||
/>
|
/>
|
||||||
<g transform={`translate(${mousePos.x * viewBoxW}, ${viewBoxH/2})`}>
|
<g transform={`translate(${mousePos.x * viewBoxW}, ${viewBoxH/2})`}>
|
||||||
<circle r="3" fill="#3b82f6" />
|
<circle r="3" fill="#3b82f6" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
)}
|
)}
|
||||||
{!hoveredSplit && !dragging && !isButtonHovered && phantomAxis === 'y' && (
|
{!hoveredSplit && !dragging && phantomAxis === 'y' && (
|
||||||
<g>
|
<g className="pointer-events-none">
|
||||||
<line
|
<line
|
||||||
x1="0" y1={mousePos.y * viewBoxH}
|
x1="0" y1={mousePos.y * viewBoxH}
|
||||||
x2="100%" y2={mousePos.y * viewBoxH}
|
x2="100%" y2={mousePos.y * viewBoxH}
|
||||||
stroke="#3b82f6" strokeWidth="4" strokeDasharray="12,8"
|
stroke="#3b82f6" strokeWidth="4" strokeDasharray="12,8"
|
||||||
className="pointer-events-none opacity-60"
|
className="opacity-60"
|
||||||
/>
|
/>
|
||||||
<g transform={`translate(${viewBoxW/2}, ${mousePos.y * viewBoxH})`}>
|
<g transform={`translate(${viewBoxW/2}, ${mousePos.y * viewBoxH})`}>
|
||||||
<circle r="3" fill="#3b82f6" />
|
<circle r="3" fill="#3b82f6" />
|
||||||
|
|||||||
Reference in New Issue
Block a user