feat(ui): remove "solid" background option

This commit is contained in:
psychedelicious
2024-08-22 17:20:28 +10:00
parent f4998bc308
commit 591e8162c1
10 changed files with 39 additions and 74 deletions

View File

@@ -89,7 +89,7 @@ const initialState: CanvasV2State = {
showHUD: true,
clipToBbox: false,
cropToBboxOnSave: false,
canvasBackgroundStyle: 'checkerboard',
dynamicGrid: false,
},
compositing: {
maskBlur: 16,
@@ -473,7 +473,7 @@ export const {
allEntitiesDeleted,
clipToBboxChanged,
canvasReset,
canvasBackgroundStyleChanged,
settingsDynamicGridToggled,
// All entities
entitySelected,
entityNameChanged,

View File

@@ -1,11 +1,11 @@
import type { PayloadAction, SliceCaseReducers } from '@reduxjs/toolkit';
import type { CanvasBackgroundStyle, CanvasV2State } from 'features/controlLayers/store/types';
import type { CanvasV2State } from 'features/controlLayers/store/types';
export const settingsReducers = {
clipToBboxChanged: (state, action: PayloadAction<boolean>) => {
state.settings.clipToBbox = action.payload;
},
canvasBackgroundStyleChanged: (state, action: PayloadAction<CanvasBackgroundStyle>) => {
state.settings.canvasBackgroundStyle = action.payload;
settingsDynamicGridToggled: (state) => {
state.settings.dynamicGrid = !state.settings.dynamicGrid;
},
} satisfies SliceCaseReducers<CanvasV2State>;

View File

@@ -834,11 +834,6 @@ export type StagingAreaImage = {
offsetY: number;
};
const zCanvasBackgroundStyle = z.enum(['checkerboard', 'dynamicGrid', 'solid']);
export type CanvasBackgroundStyle = z.infer<typeof zCanvasBackgroundStyle>;
export const isCanvasBackgroundStyle = (v: unknown): v is CanvasBackgroundStyle =>
zCanvasBackgroundStyle.safeParse(v).success;
export type CanvasV2State = {
_version: 3;
selectedEntityIdentifier: CanvasEntityIdentifier | null;
@@ -877,7 +872,7 @@ export type CanvasV2State = {
preserveMaskedArea: boolean;
cropToBboxOnSave: boolean;
clipToBbox: boolean;
canvasBackgroundStyle: CanvasBackgroundStyle;
dynamicGrid: boolean;
};
bbox: {
rect: {