feat: enhance layer masking functionality and brush controls
- Refactor LayersSheet component to support mask editing state and improve layer visibility handling. - Introduce functions to collect mask layer IDs and count display layers excluding masks. - Update BrushControls to include mask view mode options and a Done button for exiting mask editing. - Modify brush session handling to support brush previews when editing masks. - Implement a new BrushPreviewRenderer for rendering brush strokes with visual feedback. - Add document geometry utilities for transforming points and resolving layer bounds. - Ensure proper cleanup of brush preview on pointer leave and other interactions.
This commit is contained in:
@@ -3,7 +3,6 @@ import type { Dispatch } from "@commands/dispatcher";
|
||||
import type { ImageDocument } from "@core/document";
|
||||
import type { ArtboardId, LayerId } from "@core/id";
|
||||
import type { Layer } from "@core/layer";
|
||||
import type { SelectionState } from "@editor/state";
|
||||
import type { KeybindEvent } from "./keyboard";
|
||||
|
||||
export type LayerInfo = {
|
||||
@@ -17,7 +16,12 @@ export type LayerDropTarget = {
|
||||
layer: Layer;
|
||||
};
|
||||
|
||||
export function handleDeleteSelectionKey(options: { event: KeybindEvent; selection: SelectionState; dispatch: Dispatch }): boolean {
|
||||
export type DeleteSelectionState = {
|
||||
artboardId?: ArtboardId;
|
||||
layerIds: LayerId[];
|
||||
};
|
||||
|
||||
export function handleDeleteSelectionKey(options: { event: KeybindEvent; selection: DeleteSelectionState; dispatch: Dispatch }): boolean {
|
||||
if (options.event.altKey || options.event.ctrlKey || options.event.metaKey) return false;
|
||||
if (options.event.key !== "Backspace" && options.event.key !== "Delete") return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user