no message

This commit is contained in:
kuaifan 2025-09-28 08:16:53 +08:00
parent 406f64a7c5
commit 03d0f56095

View File

@ -1241,7 +1241,7 @@ export default {
x: event.clientX - containerRect.left + scrollLeft, x: event.clientX - containerRect.left + scrollLeft,
y: event.clientY - containerRect.top + scrollTop, y: event.clientY - containerRect.top + scrollTop,
}; };
this.dragSelecting = true; this.dragSelecting = this.windowLandscape;
this.dragSelectStart = start; this.dragSelectStart = start;
this.dragSelectRect = { this.dragSelectRect = {
left: start.x, left: start.x,
@ -1249,12 +1249,7 @@ export default {
width: 0, width: 0,
height: 0, height: 0,
}; };
this.dragSelectStyle = { this.setDragSelectStyle(this.dragSelectRect);
left: `${start.x - scrollLeft}px`,
top: `${start.y - scrollTop}px`,
width: '0px',
height: '0px',
};
this.dragSelectContainerSize = { this.dragSelectContainerSize = {
width: container.scrollWidth, width: container.scrollWidth,
height: container.scrollHeight, height: container.scrollHeight,
@ -1298,12 +1293,7 @@ export default {
const height = Math.abs(start.y - currentY); const height = Math.abs(start.y - currentY);
const rect = {left, top, width, height}; const rect = {left, top, width, height};
this.dragSelectRect = rect; this.dragSelectRect = rect;
this.dragSelectStyle = { this.setDragSelectStyle(rect);
left: `${left - scrollLeft}px`,
top: `${top - scrollTop}px`,
width: `${width}px`,
height: `${height}px`,
};
if (!this.dragSelectMoved && (width > 3 || height > 3)) { if (!this.dragSelectMoved && (width > 3 || height > 3)) {
this.dragSelectMoved = true; this.dragSelectMoved = true;
} }
@ -1391,6 +1381,19 @@ export default {
this.selectedItems = next; this.selectedItems = next;
}, },
setDragSelectStyle(rect) {
if (!rect) {
this.dragSelectStyle = {};
return;
}
this.dragSelectStyle = {
left: `${rect.left}px`,
top: `${rect.top}px`,
width: `${rect.width}px`,
height: `${rect.height}px`,
};
},
rectsIntersect(a, b) { rectsIntersect(a, b) {
if (!a || !b) { if (!a || !b) {
return false; return false;