Skip to content

Commit d4445e9

Browse files
committed
fix(editor): show scissors cursor when clip tool is active
1 parent c9c4aea commit d4445e9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

apps/desktop/src/routes/editor/Timeline/ClipTrack.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ export function ClipTrack(
195195
const hasMultipleRecordingSegments = () =>
196196
editorInstance.recordings.segments.length > 1;
197197

198+
const split = () => editorState.timeline.interactMode === "split";
199+
198200
return (
199201
<TrackRoot ref={props.ref}>
200202
<For each={segments()}>
@@ -351,6 +353,7 @@ export function ClipTrack(
351353
isSelected()
352354
? "wobble-wrapper border-gray-12"
353355
: "border-transparent",
356+
split() ? "timeline-scissors-cursor" : "",
354357
)}
355358
innerClass="ring-blue-9"
356359
segment={relativeSegment}
@@ -406,6 +409,7 @@ export function ClipTrack(
406409
onMouseDown={(downEvent) => {
407410
const start = segment.start;
408411

412+
if(split()) return;
409413
const maxSegmentDuration =
410414
editorInstance.recordings.segments[
411415
segment.recordingSegment ?? 0
@@ -496,6 +500,7 @@ export function ClipTrack(
496500
onMouseDown={(downEvent) => {
497501
const end = segment.end;
498502

503+
if(split()) return;
499504
const maxSegmentDuration =
500505
editorInstance.recordings.segments[
501506
segment.recordingSegment ?? 0

apps/desktop/src/routes/editor/Timeline/styles.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@
1212
animation: wobble 1s ease-in-out infinite;
1313
will-change: transform;
1414
}
15+
16+
.timeline-scissors-cursor {
17+
cursor: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5 2.5C3.15905 2.5 1.66666 3.99238 1.66666 5.83333C1.66666 7.67428 3.15905 9.16667 5 9.16667C5.85421 9.16667 6.63337 8.84536 7.22322 8.317L9.74771 10L7.22322 11.683C6.63337 11.1546 5.85421 10.8333 5 10.8333C3.15905 10.8333 1.66666 12.3257 1.66666 14.1667C1.66666 16.0076 3.15905 17.5 5 17.5C6.84095 17.5 8.33333 16.0076 8.33333 14.1667C8.33333 13.7822 8.26824 13.4129 8.14846 13.0692L18.6556 6.06446C18.1451 5.29858 17.1103 5.09162 16.3444 5.60221L11.25 8.99846L8.14846 6.93075C8.26824 6.5871 8.33333 6.21782 8.33333 5.83333C8.33333 3.99238 6.84095 2.5 5 2.5ZM3.33333 5.83333C3.33333 4.91286 4.07952 4.16667 5 4.16667C5.92047 4.16667 6.66666 4.91286 6.66666 5.83333C6.66666 6.75381 5.92047 7.5 5 7.5C4.07952 7.5 3.33333 6.75381 3.33333 5.83333ZM3.33333 14.1667C3.33333 13.2462 4.07952 12.5 5 12.5C5.92047 12.5 6.66666 13.2462 6.66666 14.1667C6.66666 15.0871 5.92047 15.8333 5 15.8333C4.07952 15.8333 3.33333 15.0871 3.33333 14.1667Z' fill='%23ffffff'/%3E%3Cpath d='M16.3444 14.3978L12.0012 11.5023L13.5035 10.5008L18.6556 13.9355C18.1451 14.7014 17.1103 14.9084 16.3444 14.3978Z' fill='%23ffffff'/%3E%3C/svg%3E")
18+
10 10,
19+
crosshair;
20+
}
21+
22+
.timeline-scissors-cursor * {
23+
cursor: inherit;
24+
}

0 commit comments

Comments
 (0)