Skip to content

Commit 8da86d8

Browse files
committed
feat: Add resize and reposition support for Rectangle and Ellipse shapes
1 parent efbd25b commit 8da86d8

File tree

13 files changed

+646
-313
lines changed

13 files changed

+646
-313
lines changed

apps/collabydraw/app/globals.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ h6 {
186186
--button-active-bg: var(--color-surface-high);
187187
--button-active-border: var(--brand-active);
188188
--color-promo: var(--color-primary);
189+
190+
--selection-box-border-color: #6965db;
189191
}
190192

191193
.dark {
@@ -224,7 +226,6 @@ h6 {
224226
--surface-box-shadow: #121212;
225227
--shadow-island: 0px 0px .9310142993927002px 0px rgba(0, 0, 0, .17), 0px 0px 3.1270833015441895px 0px rgba(0, 0, 0, .08), 0px 7px 14px 0px rgba(0, 0, 0, .05);
226228

227-
--color-primary: #a8a5ff;
228229
--color-primary-darker: #b2aeff;
229230
--color-primary-darkest: #beb9ff;
230231
--color-primary-light: #4f4d6f;
@@ -269,6 +270,8 @@ h6 {
269270
--button-active-bg: var(--color-surface-high);
270271
--button-active-border: var(--brand-active);
271272
--color-promo: var(--color-primary);
273+
274+
--selection-box-border-color: #a8a5ff;
272275
}
273276
}
274277

apps/collabydraw/components/canvas/StandaloneCanvas.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,19 @@ export function StandaloneCanvas() {
282282
input.click();
283283
}, [game]);
284284

285+
const handleToolSelect = (tool: ToolType) => {
286+
setActiveTool(tool);
287+
game?.setTool(tool);
288+
if (tool !== "selection") {
289+
game?.updateShapes(existingShapes);
290+
}
291+
};
292+
293+
useEffect(() => {
294+
//
295+
296+
}, []);
297+
285298
return (
286299
<div data-isloading={isLoading} data-matches={matches} className={`collabydraw h-screen overflow-hidden ${(activeTool === "grab" && !sidebarOpen) ? (grabbing ? "cursor-grabbing" : "cursor-grab") : "cursor-crosshair"} `}>
287300
{!isLoading && (
@@ -326,7 +339,7 @@ export function StandaloneCanvas() {
326339

327340
<Toolbar
328341
selectedTool={activeTool}
329-
onToolSelect={setActiveTool}
342+
onToolSelect={handleToolSelect}
330343
/>
331344

332345
<CollaborationStart />

0 commit comments

Comments
 (0)