Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CageUI/resources/web/CageUI/static/RoomBorder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions CageUI/src/client/components/layoutEditor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ const Editor: FC<EditorProps> = ({roomSize}) => {
const updateItemType: RoomItemType = stringToRoomItem(parseWrapperId(draggedNodeId));

if (targetRect) {
const cellX = Math.max(0,targetRect.x);
const cellY = Math.max(0,targetRect.y);
// update the found x and y coords with new cell coords if the object was outside the available layout range.
const cellX = targetRect.x < SVG_WIDTH && targetRect.x > 0 ? targetRect.x : 0;
const cellY = targetRect.y < SVG_HEIGHT && targetRect.y > 0 ? targetRect.y : 0;

let newId: string;

Expand Down
4 changes: 2 additions & 2 deletions CageUI/src/client/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import { Modification, ModLocations, ModRecord, ModTypes } from '../types/typings';

export const CELL_SIZE = 30; // number of pixels of a cell for length/width
export const SVG_WIDTH = 1290; // width of the layout svg
export const SVG_HEIGHT = 810; // height of the layout svg
export const SVG_WIDTH = 810; // width of the layout svg
export const SVG_HEIGHT = 1290; // height of the layout svg

//TODO finish styles
export const Modifications: ModRecord = {
Expand Down