Configurable grid + snap-to-grid in the layout system (#45)
Build image / build-and-push (push) Successful in 7s
Build image / build-and-push (push) Successful in 7s
Closes #44. Two independent grids (garden + per-bed), each with a size and a snap toggle; snapping defaults off. See PR #45 for details. Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #45.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
-- Grid + snap settings for the layout system.
|
||||
--
|
||||
-- Two independent grids:
|
||||
-- * gardens.grid_size_cm / snap_to_grid — the garden-scale grid the visual grid
|
||||
-- is drawn from and (when snap is on) objects snap to when placed/moved/resized.
|
||||
-- Defaults to 100 cm (1 m), matching the editor's previous fixed grid.
|
||||
-- * garden_objects.grid_size_cm / snap_to_grid — a per-object grid used inside a
|
||||
-- plantable bed: when snap is on, plants snap to it. Defaults to 30 cm (~1 ft),
|
||||
-- a practical bed cell.
|
||||
--
|
||||
-- snap defaults to off on both, so existing gardens keep free placement until the
|
||||
-- owner (garden grid) or an editor (bed grid) opts in.
|
||||
ALTER TABLE gardens ADD COLUMN grid_size_cm REAL NOT NULL DEFAULT 100;
|
||||
ALTER TABLE gardens ADD COLUMN snap_to_grid INTEGER NOT NULL DEFAULT 0 CHECK (snap_to_grid IN (0, 1));
|
||||
|
||||
ALTER TABLE garden_objects ADD COLUMN grid_size_cm REAL NOT NULL DEFAULT 30;
|
||||
ALTER TABLE garden_objects ADD COLUMN snap_to_grid INTEGER NOT NULL DEFAULT 0 CHECK (snap_to_grid IN (0, 1));
|
||||
Reference in New Issue
Block a user