Skip to content

Commit 92336b8

Browse files
authored
feat: support shift/meta multi-select and multi-drag on screen image area (#33)
Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
1 parent 2d9ae45 commit 92336b8

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/components/ScreenNode.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export function ScreenNode({
363363
{/* Image */}
364364
<div
365365
className="screen-image-area"
366-
style={{ position: "relative", minHeight: DEFAULT_IMAGE_HEIGHT, background: COLORS.imageAreaBg }}
366+
style={{ position: "relative", minHeight: DEFAULT_IMAGE_HEIGHT, background: COLORS.imageAreaBg, cursor: "default" }}
367367
onMouseDown={(e) => {
368368
if (isSpaceHeld?.current) return;
369369
if (e.target.closest(".hotspot-area") || e.target.closest(".hotspot-drag-handle") || e.target.closest(".resize-handle") || e.target.closest(".comment-pin")) return;
@@ -375,6 +375,18 @@ export function ScreenNode({
375375
onCommentImageClick(e, screen.id, xPct, yPct);
376376
return;
377377
}
378+
if (!isReadOnly) {
379+
if (e.shiftKey || e.metaKey) {
380+
e.stopPropagation();
381+
onToggleSelect?.("screen", screen.id);
382+
return;
383+
}
384+
if (isMultiSelected) {
385+
onMultiDragStart?.(e);
386+
return;
387+
}
388+
}
389+
onSelect(screen.id);
378390
if (screen.imageData && onImageAreaMouseDown) {
379391
onImageAreaMouseDown(e, screen.id);
380392
}

0 commit comments

Comments
 (0)