上下左右位置更新

v1.2.0
于肖磊 2025-02-26 16:41:12 +08:00
parent c02e08229d
commit 0a59b5e682
1 changed files with 3 additions and 2 deletions

View File

@ -1092,12 +1092,13 @@ const handleKeyUp = (e: KeyboardEvent) => {
diy_data.value.forEach(item => {
//
if (item.show_tabs == '1') {
const { id = '', type = 'left' } = item.com_data?.data_follow || { id: '', type: 'left' };
// x 0
if (isWithinBounds(item.location.x + x, item.com_data.com_width, 390)) {
if (isWithinBounds(item.location.x + x, item.com_data.com_width, 390) && (id === '' || (id != '' && type == 'top'))) {
item.location.x += x;
}
// Y0
if (isWithinBounds(item.location.y + y, item.com_data.com_height, center_height.value)) {
if (isWithinBounds(item.location.y + y, item.com_data.com_height, center_height.value) && (id === '' || (id != '' && type == 'left'))) {
item.location.y += y;
item.location.staging_y += y;
}