fix grid add text
This commit is contained in:
@@ -71,8 +71,8 @@ const EditorCanvas = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleCellDblClick = (tableId: string, cellId: string, x: number, y: number, text: string) => {
|
||||
setEditingCell({ tableId, cellId, x, y, value: text });
|
||||
const handleCellDblClick = (tableId: string, cellId: string, x: number, y: number, width: number, height: number, text: string) => {
|
||||
setEditingCell({ tableId, cellId, x, y, width, height, value: text });
|
||||
};
|
||||
|
||||
const handleCellEditorSave = (text: string) => {
|
||||
@@ -228,23 +228,17 @@ const EditorCanvas = () => {
|
||||
</Layer>
|
||||
</Stage>
|
||||
</div>
|
||||
{editingCell && (() => {
|
||||
const obj = objects.find((o) => o.id === editingCell.tableId);
|
||||
if (!obj || !obj.tableData) return null;
|
||||
const cell = obj.tableData.cells[editingCell.cellId];
|
||||
if (!cell) return null;
|
||||
return (
|
||||
<CellEditor
|
||||
x={editingCell.x}
|
||||
y={editingCell.y}
|
||||
width={cell.width}
|
||||
height={cell.height}
|
||||
value={editingCell.value}
|
||||
onSave={handleCellEditorSave}
|
||||
onCancel={handleCellEditorCancel}
|
||||
/>
|
||||
);
|
||||
})()}
|
||||
{editingCell && (
|
||||
<CellEditor
|
||||
x={editingCell.x}
|
||||
y={editingCell.y}
|
||||
width={editingCell.width}
|
||||
height={editingCell.height}
|
||||
value={editingCell.value}
|
||||
onSave={handleCellEditorSave}
|
||||
onCancel={handleCellEditorCancel}
|
||||
/>
|
||||
)}
|
||||
<ZoomControls />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user