diff --git a/src/pages/editor/components/canvas/ObjectRenderer.tsx b/src/pages/editor/components/canvas/ObjectRenderer.tsx index 9441d8d..da95711 100644 --- a/src/pages/editor/components/canvas/ObjectRenderer.tsx +++ b/src/pages/editor/components/canvas/ObjectRenderer.tsx @@ -53,8 +53,6 @@ const ObjectRenderer = ({ return ; } return ; - case "circle": - return ; case "text": return ; case "line": diff --git a/src/pages/editor/components/canvas/drawingUtils.ts b/src/pages/editor/components/canvas/drawingUtils.ts index 7365eb4..2676b8f 100644 --- a/src/pages/editor/components/canvas/drawingUtils.ts +++ b/src/pages/editor/components/canvas/drawingUtils.ts @@ -33,21 +33,6 @@ export const createDrawingObject = ({ }; } - if (tool === "circle") { - const radius = Math.sqrt(width * width + height * height); - return { - id: tempObject?.id || `circle-${Date.now()}`, - type: "circle", - x: startPos.x, - y: startPos.y, - width: radius * 2, - height: radius * 2, - fill: "#10b981", - stroke: "#059669", - strokeWidth: 0, - }; - } - if (tool === "line") { return { id: tempObject?.id || `line-${Date.now()}`, diff --git a/src/pages/editor/components/canvas/useDrawingHandlers.ts b/src/pages/editor/components/canvas/useDrawingHandlers.ts index 66d3bcb..eec0ad9 100644 --- a/src/pages/editor/components/canvas/useDrawingHandlers.ts +++ b/src/pages/editor/components/canvas/useDrawingHandlers.ts @@ -91,15 +91,12 @@ export const useDrawingHandlers = () => { addObject(newObject); setTempObject(newObject); } else { - const updates: Partial = - tool === "circle" - ? { width: newObject.width, height: newObject.height } - : { - x: newObject.x, - y: newObject.y, - width: newObject.width, - height: newObject.height, - }; + const updates: Partial = { + x: newObject.x, + y: newObject.y, + width: newObject.width, + height: newObject.height, + }; updateObject(tempObject.id, updates); } }; diff --git a/src/pages/editor/components/sidebar/ObjectSettings.tsx b/src/pages/editor/components/sidebar/ObjectSettings.tsx index 4d21293..ebb8ea4 100644 --- a/src/pages/editor/components/sidebar/ObjectSettings.tsx +++ b/src/pages/editor/components/sidebar/ObjectSettings.tsx @@ -32,7 +32,7 @@ const ObjectSettings = ({ selectedObject, onUpdate, onDelete }: ObjectSettingsPr {selectedObject.type === "text" && } - {(selectedObject.type === "rectangle" || selectedObject.type === "circle") && ( + {selectedObject.type === "rectangle" && ( )} diff --git a/src/pages/editor/components/sidebar/ToolInstructions.tsx b/src/pages/editor/components/sidebar/ToolInstructions.tsx index ff63b72..9a49d47 100644 --- a/src/pages/editor/components/sidebar/ToolInstructions.tsx +++ b/src/pages/editor/components/sidebar/ToolInstructions.tsx @@ -6,7 +6,6 @@ import { LinkInput, SelectInstruction, RectangleInstruction, - CircleInstruction, TextInstruction, LineInstruction, ArrowInstruction, @@ -67,7 +66,6 @@ const ToolInstructions = ({ tool }: ToolInstructionsProps) => { const simpleInstructions: Partial> = { select: , rectangle: , - circle: , text: , line: , arrow: , diff --git a/src/pages/editor/components/sidebar/ToolsBar.tsx b/src/pages/editor/components/sidebar/ToolsBar.tsx index 86b4531..0bb87c2 100644 --- a/src/pages/editor/components/sidebar/ToolsBar.tsx +++ b/src/pages/editor/components/sidebar/ToolsBar.tsx @@ -17,7 +17,6 @@ import type { ToolType } from "../../store/editorStore"; const tools: Array<{ icon: (color: string, variant?: "Bold" | "Outline" | "Broken" | "Bulk" | "Linear" | "TwoTone") => React.ReactNode; tool: ToolType; label: string }> = [ { icon: (color, variant) => , tool: "select", label: "انتخاب" }, { icon: (color, variant) => , tool: "rectangle", label: "مستطیل" }, - { icon: (color, variant) => , tool: "circle", label: "دایره" }, { icon: (color, variant) => , tool: "text", label: "متن" }, { icon: (color, variant) => , tool: "line", label: "خط" }, { icon: (color, variant) => , tool: "grid", label: "گرید" }, diff --git a/src/pages/editor/store/editorStore.ts b/src/pages/editor/store/editorStore.ts index c1722d3..6a0ac2d 100644 --- a/src/pages/editor/store/editorStore.ts +++ b/src/pages/editor/store/editorStore.ts @@ -5,7 +5,6 @@ import type { ShapeType } from "./shapeStore"; export type ToolType = | "select" | "rectangle" - | "circle" | "text" | "image" | "line"