添加注释

v1.0.0
于肖磊 2024-08-16 18:30:27 +08:00
parent 37b23a146f
commit 81edd10bfa
1 changed files with 4 additions and 1 deletions

View File

@ -377,9 +377,11 @@ const start_drag_area_box = (index: number, event: MouseEvent) => {
y: clone_drag_start.y - event.clientY,
};
is_draggable.value = false;
//
const rect1 = { x: clone_drag_start.x, y: clone_drag_start.y, width: clone_drag_end.width, height: clone_drag_end.height }
diy_data.value.forEach(item => {
const rect2 = { x: item.location.x, y: item.location.y, width: item.com_data.com_width, height: item.com_data.com_height };
// truefalse
item.is_hot = isRectangleIntersecting(rect1, rect2);
});
@ -411,7 +413,7 @@ const start_drag_area_box = (index: number, event: MouseEvent) => {
const move_y = new_coordinate.y - clone_drag_start.y;
// ,
diy_data.value.forEach(item => {
if (item.is_hot) {
if (item.is_hot) { //
let { record_x, record_y} = cloneDeep(item.location);
item.location.x = Math.max(0, record_x + move_x);
item.location.y = Math.max(0, record_y + move_y);
@ -426,6 +428,7 @@ const start_drag_area_box = (index: number, event: MouseEvent) => {
document.onmouseup = () => {
is_draggable.value = true;
drag_box_bool.value = false;
// xy
diy_data.value.forEach(item => {
if (item.is_hot) {
const { x, y } = cloneDeep(item.location);