- Adjusted button styles across various components for consistency and better UX. - Enhanced layout of action controls to utilize whitespace more effectively. - Updated slider styles for a more modern appearance and improved usability. - Refined input fields and labels for better accessibility and readability. - Introduced new app surface styles for a cohesive design across the application. - Added tests for canvas cursor behavior to ensure correct cursor display during operations.
14 lines
787 B
TypeScript
14 lines
787 B
TypeScript
import type { InteractionMode } from "@editor/tools";
|
|
import { isPanInteractionMode } from "@editor/tools";
|
|
export function canvasCursorClass(interactionMode: InteractionMode, isPanning: boolean, hasBrushPreview = false, canBrush = true, operationOpen = false) {
|
|
if (operationOpen) return "cursor-default";
|
|
if (isPanning) return "cursor-grabbing";
|
|
if (isPanInteractionMode(interactionMode)) return "cursor-grab";
|
|
if (interactionMode.type === "tool" && (interactionMode.tool === "brush" || interactionMode.tool === "eraser")) {
|
|
if (!canBrush) return "cursor-not-allowed";
|
|
return hasBrushPreview ? "cursor-none" : "cursor-crosshair";
|
|
}
|
|
if (interactionMode.type === "tool" && interactionMode.tool === "magicWand") return "cursor-crosshair";
|
|
return "cursor-default";
|
|
}
|