Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit bf099d8

Browse files
author
ge85riz
committed
🚑 hotfix: fix initial parameters of walls to make them draggable even when ElementInspector window is open.
1 parent ca5584a commit bf099d8

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎frontend/src/components/canvas/EventListeners.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ import {
1212
updateMultipleWithoutUndoRedo,
1313
} from "components/canvas/actions/actions.tsx";
1414
import Konva from "konva";
15-
import {
16-
type ElementProperties,
17-
shapeFactory,
18-
type UUID,
19-
} from "components/canvas/utils/constants.tsx";
15+
import { type ElementProperties, shapeFactory, type UUID } from "components/canvas/utils/constants.tsx";
2016
import type { Chair } from "components/canvas/elements/Chair.tsx";
2117
import type { AppState } from "components/canvas/reducers/CanvasReducer.tsx";
2218
import React from "react";
@@ -274,7 +270,7 @@ export const handleMouseDown = (
274270

275271
const stageCenter = { x: 0, y: 0 };
276272
let element = shapeFactory("wall", stageCenter) as Wall;
277-
element = { ...element, x1, y1, x2, y2 } as Wall;
273+
element = { ...element, x1, y1, x2, y2, x: 0, y: 0 } as Wall;
278274

279275
dispatch(addElement(element));
280276

‎frontend/src/components/canvas/elements/Wall.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export class Wall implements ElementProperties {
2424
constructor(stageCenter?: { x: number; y: number }) {
2525
this.id = uuidv4();
2626
this.type = "wall";
27+
this.x = 0;
28+
this.y = 0;
2729
this.x1 = stageCenter?.x ?? 200;
2830
this.y1 = stageCenter?.y ?? 100;
2931
this.x2 = (stageCenter?.x ?? 200) + 150;

0 commit comments

Comments
 (0)