3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useRef, useState, useMemo } from 'react';
|
||||
import { AppConfig, LayoutSplits, Partition } from '../types';
|
||||
// ИСПРАВЛЕНИЕ: Добавлена иконка Move в импорты
|
||||
import { Grid, MousePointer2, Trash2, RotateCcw, X, Plus, Move } from 'lucide-react';
|
||||
// Импортируем только то, что реально используем
|
||||
import { Grid, MousePointer2, Trash2, RotateCcw, X, Plus } from 'lucide-react';
|
||||
|
||||
interface Props {
|
||||
config: AppConfig;
|
||||
@@ -49,7 +49,6 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
||||
const drawerD = Math.max(1, config.drawer.depth || 400);
|
||||
const aspectRatio = drawerD / drawerW;
|
||||
|
||||
// ViewBox (internal SVG coordinates)
|
||||
const viewBoxW = 1000;
|
||||
const viewBoxH = viewBoxW * aspectRatio;
|
||||
|
||||
@@ -282,7 +281,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
||||
<div className="flex bg-slate-800 p-1 rounded-lg border border-slate-700">
|
||||
<button onClick={() => { setMode('lines'); setSelectedPartitionId(null); }}
|
||||
className={`flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-bold transition-all ${mode === 'lines' ? 'bg-primary text-white shadow' : 'text-gray-400 hover:text-gray-200'}`}>
|
||||
<Move size={14}/> Границы
|
||||
<MousePointer2 size={14}/> Границы
|
||||
</button>
|
||||
<button onClick={() => setMode('cells')}
|
||||
className={`flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-bold transition-all ${mode === 'cells' ? 'bg-primary text-white shadow' : 'text-gray-400 hover:text-gray-200'}`}>
|
||||
@@ -331,7 +330,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
||||
viewBox={`0 0 ${viewBoxW} ${viewBoxH}`}
|
||||
className="w-full h-full touch-none block"
|
||||
preserveAspectRatio="none"
|
||||
onMouseMove={handleMouseMove}
|
||||
onMouseMove={handleGlobalMouseMove}
|
||||
onMouseDown={handleMouseDown}
|
||||
onMouseUp={() => setDragging(null)}
|
||||
onMouseLeave={() => setDragging(null)}
|
||||
@@ -354,6 +353,7 @@ export const LayoutStep: React.FC<Props> = ({ config, splits, onChange }) => {
|
||||
|
||||
const key = `${i}-${j}`;
|
||||
const parts = safePartitions[key] || [];
|
||||
|
||||
const isHovered = hoveredCell?.i === i && hoveredCell?.j === j && mode === 'cells';
|
||||
const isAnyPartSelected = parts.some(p => p.id === selectedPartitionId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user