Add custom SVG cursors and update cursor handling

- Introduced new SVG cursor assets: cross, default, export, move, open, pen, and pointing.
- Implemented SCSS styles for cursor usage in the scene container, defining specific cursors for different modes (draw, pointer, pen, measure, hand).
- Enhanced cursor functionality by adding a utility function to handle canvas cursor changes based on user actions, mapping specific actions to corresponding cursor styles.
This commit is contained in:
2025-07-11 09:26:21 +05:30
parent 6f7f6549db
commit 5d40139e95
14 changed files with 261 additions and 118 deletions

View File

@@ -0,0 +1,47 @@
$cursor-default: url("../../assets/cursors/default.svg") 0 0, default;
$cursor-pen: url("../../assets/cursors/pen.svg") 0 0, default;
$cursor-delete: url("../../assets/cursors/pointing.svg") 4 0, default;
$cursor-draw: url("../../assets/cursors/cell.svg") 8 8, default;
$cursor-cross: url("../../assets/cursors/cross.svg") 8 8, default;
$cursor-grab: url("../../assets/cursors/open.svg") 8 8, default;
$cursor-grabing: url("../../assets/cursors/close.svg") 8 8, default;
.scene-container {
canvas {
cursor: $cursor-default !important;
}
}
.scene-container.draw {
canvas {
cursor: $cursor-draw !important;
}
}
.scene-container.pointer {
canvas {
cursor: $cursor-delete !important;
}
}
.scene-container.pen {
canvas {
cursor: $cursor-pen !important;
}
}
.scene-container.measure {
canvas {
cursor: $cursor-cross !important;
}
}
.scene-container.hand {
canvas {
cursor: $cursor-grab !important;
&:active{
cursor: $cursor-grabing !important;
}
}
}